PaulieThePolarBear
New member
- Joined
- Sep 14, 2018
- Messages
- 2
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- Office 365
I have a table in a SQL Server database with 431 million records. I want to apply a simple filter to 3 columns that will result in approx 100 records being returned.
I've tried this 3 ways
1. Using From Database > From SQL Server.
a. Entering the value in Server and Database and clicking OK
b. Selecting my table from the Navigator window and clicking Edit
c. In the Power Query window, applying the filter to the 3 columns and then loading to an Excel sheet
2. Using From Other Sources > From ODBC
a. Selecting the name of my DSN in the Data Source Name (DSN) box and entering the SQL Statement "SELECT * FROM MyTable WHERE A = ? and B = ?? and C = ???".
b. Loading my results to an Excel sheet
3. Using From Other Sources > From ODBC
a. Selecting the name of my DSN in the Data Source Name (DSN) box and click OK
b. Selecting my table from the Navigator window and clicking Edit
c. In the Power Query window, applying the filter to the 3 columns and then loading to an Excel sheet
Using methods 1 and 2, my query refreshes in a matter of seconds. Using method 3, when I load the query, the Queries & Connections pane shows XX rows from dsn = YY. XX slowly increases and gets to about 3 million records in about 30 seconds and starts to chew up memory and I end up cancelling the refresh as who has time for that!!! :tongue: I've never left it to finish so don't know if it will ever load or I'll end up running out of memory and Excel will crash.
When I look at the final step in Power Query for methods 1, I get the View Native Query option.
When I do the same thing for method 3, I don't get this option. My understanding of Query Folding means that, in simplified terms, all the leg work to get my final results is now being done on my machine, rather than on the server.
Is the slowness on method 3 a known issue with Power Query, ODBC and large tables? Or is this a pointer to a potentially bad driver? Is there a workaround to make this run in a similar time to method 1 or 2?
I'm using Office 365 version 1808 32-bit Excel.
I've tried this 3 ways
1. Using From Database > From SQL Server.
a. Entering the value in Server and Database and clicking OK
b. Selecting my table from the Navigator window and clicking Edit
c. In the Power Query window, applying the filter to the 3 columns and then loading to an Excel sheet
2. Using From Other Sources > From ODBC
a. Selecting the name of my DSN in the Data Source Name (DSN) box and entering the SQL Statement "SELECT * FROM MyTable WHERE A = ? and B = ?? and C = ???".
b. Loading my results to an Excel sheet
3. Using From Other Sources > From ODBC
a. Selecting the name of my DSN in the Data Source Name (DSN) box and click OK
b. Selecting my table from the Navigator window and clicking Edit
c. In the Power Query window, applying the filter to the 3 columns and then loading to an Excel sheet
Using methods 1 and 2, my query refreshes in a matter of seconds. Using method 3, when I load the query, the Queries & Connections pane shows XX rows from dsn = YY. XX slowly increases and gets to about 3 million records in about 30 seconds and starts to chew up memory and I end up cancelling the refresh as who has time for that!!! :tongue: I've never left it to finish so don't know if it will ever load or I'll end up running out of memory and Excel will crash.
When I look at the final step in Power Query for methods 1, I get the View Native Query option.
When I do the same thing for method 3, I don't get this option. My understanding of Query Folding means that, in simplified terms, all the leg work to get my final results is now being done on my machine, rather than on the server.
Is the slowness on method 3 a known issue with Power Query, ODBC and large tables? Or is this a pointer to a potentially bad driver? Is there a workaround to make this run in a similar time to method 1 or 2?
I'm using Office 365 version 1808 32-bit Excel.