Query folding
Query folding is one of the most important aspects for optimizing your queries’ performance and is useful for any developer who connects to external data sources. It’s a process where the evaluation of a query is offloaded to the data source itself.
During query folding, Power Query’s mashup engine converts a query’s transformations into the data source’s native language. This approach combines multiple transformation steps into one efficient query that the data source can execute.
Doing so transfers the computational load of these transformations from the local environment, where Power Query operates, directly to the data source, like an SQL database. Any remaining transformations that can’t be folded are performed locally.
The primary goal of query folding is to reduce memory usage in Power Query by using the computational power of the data source to process queries and transformations. For instance...