PowerBI performance with Databricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 12:21 AM - edited 12-09-2024 12:23 AM
We have integrated PowerBI with Databricks to generate reports. However, PowerBI generates over 8,000 lines of code, including numerous OR clauses, which cannot be modified at this time. This results in queries that take more than 4 minutes to execute and are automatically cancelled before a plan is generated. The time required for query optimization and file pruning further delays the process, preventing the plan from being generated. As a result, we are unable to use the report with Databricks, as queries containing numerous OR clauses are either taking an excessive amount of time to execute or failing altogether.
Please note that we have already implemented optimization techniques within Databricks, and our data consists of small files, such as 1 file in the DIM table and 22 files in the FACT tables. Adjusting the size of the serverless SQL warehouse has not resolved the issue.
If anyone has successfully addressed this issue, please share your solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 01:13 AM
Hi,
- Use the
BROADCAST
hint to optimize the join between the DIM and FACT tables. This can help reduce the amount of data that needs to be processed and improve the performance of the query. - Use the
MERGE
statement to combine the OR clauses into a single query. This can help reduce the number of queries that are generated and improve the performance of the query. - Use the
OPTIMIZE
command to optimize the Delta tables. This can help improve the performance of the query by reducing the amount of data that needs to be read and processed. - Use the
VACUUM
command to remove any deleted files from the Delta tables. This can help improve the performance of the query by reducing the amount of data that needs to be read and processed. - Use the
ZORDER
command to optimize the layout of the Delta tables. This can help improve the performance of the query by reducing the amount of data that needs to be read and processed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 01:33 AM
@Sidhant07 The issue is not related to the volume of data, as it is relatively small. Rather, the challenge lies in the time it takes to generate the plan in Databricks, which results in the process being automatically cancelled. Consequently, we are unable to retrieve the complete query from the query history. Additionally, we cannot modify the query generated by PowerBI at this time. We have already implemented liquid clustering for the FACT and DIM tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 02:06 AM
As per our analysis, “joins” are not a problem but the huge “where” clause with lot of “OR” conditions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 07:27 AM
Attached is the sample query generated by Power BI. Without the OR conditions the query runs within seconds.

