Aug 05 2024 01:43 PM
Good day.
I have filtered queries that merge into a single query. The end result in Excel is about 20,000 rows. When refreshing, it counts up to 3.6 million rows.
This is problematic for speed - but I cannot figure out where to determine the problem spot. I say "problem" because the query loads about 20,000 rows per second until about 3.1 million rows...then slows to about 100 rows per second until about 3.4 million when the speed returns to about 20,000 per second.
Questions:
- When refreshing a query (or in the preview mode in the Power Query Editor), what is the "Rows Loaded" actually counting? [[If I have filtered rows, why does it count so many more?]]
- What would explain the variable speeds in refreshing?
- How can I trouble shoot to find what is slowing refresh?
- Should I change how I think about this in any way?
Thank you for any help.
Aug 05 2024 02:06 PM - edited Aug 05 2024 02:07 PM
SolutionPower Query doesn't keep resulting tables in memory, it re-evaluates each time it is called.
Let assume you have
Query1 with 1M rows
Query2 with 1M rows
Query3 which merge Query1 and Query2 and gives another 1M rows
Q4 (query or step, doesn't matter) which filter Query3 down to 100 rows
When you call Q4 it evaluates Q1, when Q2, when Q3 which means you are loading on this step at least 3M rows.
How to minimize, if possible, very depends on concrete queries and steps.
Aug 05 2024 02:56 PM
Aug 05 2024 11:36 PM
Something like this. In some cases Table.Buffer could help to reuse the cache, but not necessary. In majority of cases cache will be re-evaluated.
If you take data from the database, especially SQL database, pay attention to query folding. That allows to do all calculations on the server, which is much faster.
If query folding in general works in your setup, check steps which breaks query folding and, where possible, try to modify the query to avoid such steps.
Aug 05 2024 02:06 PM - edited Aug 05 2024 02:07 PM
SolutionPower Query doesn't keep resulting tables in memory, it re-evaluates each time it is called.
Let assume you have
Query1 with 1M rows
Query2 with 1M rows
Query3 which merge Query1 and Query2 and gives another 1M rows
Q4 (query or step, doesn't matter) which filter Query3 down to 100 rows
When you call Q4 it evaluates Q1, when Q2, when Q3 which means you are loading on this step at least 3M rows.
How to minimize, if possible, very depends on concrete queries and steps.