Ad-hoc reporting response time degrades with large crosstab views and multiple dimension filters

shrutidev
Wed, 03 Dec 2025 10:44:14 +0000

That SQL query is inefficient because it’s retrieving all combinations before filtering. Your database is probably doing a full table scan on 2M rows every time. Have you checked if there are proper indexes on date_key, region, product, customer, and sales_rep columns? Without indexes, the database can’t optimize the WHERE clause or GROUP BY operations.