SELECT dimension, measure
FROM table
WHERE filter = ?
GROUP BY 1
You can save a lot of compute time by creating a materialized view [1] of: SELECT dimension, filter, measure
FROM table
GROUP BY 1, 2
and the query optimizer will even automatically redirect your query for you! At this point, the main thing we need is for BI tools to take advantage of this capability in the background.[1] https://docs.snowflake.com/en/user-guide/views-materialized....