Filters with no data generate unnecessary joins

  • 17 September 2018
  • 3 replies

My Looker setup contains dashboards that have many filters (usually between 6-10) in order to enable self-serve analytics reporting for my users (so that they may optionally filter by date, user name, browser, etc.) – this means most of these filters are often unused for any particular query, but any individual filter could be required due to the “long tail” of reporting that needs to be handled.

I have come across an interesting wrinkle that is hindering query performance across the board – namely, that setting a join-dependent filter with no query data will generate SQL that performs the join required for that filter. This results in unnecessary joins that hinder performance.

In the below screenshot, I am Exploring the Visit view (which directly mirrors an underlying redshift table), which can join on the Client, Country, and Users tables. I have set up filters from these joined tables, but not yet entered any query data to filter on.

The Look-ML generated SQL contains joins on these tables, even though I am not actually querying these tables for any data.

Can I set Looker to only create these joins if their underlying filters have data? If not, how can I structure my dashboards to solve this problem, while still meeting the requirements of providing “long tail” self-serve analytics reporting capabilities?

3 replies

Hey Elias,

Thanks for reaching out. This is an issue our team was aware of and it looks like there is a fix for this behavior coming in the next few releases. It looks slated for version 5.24 but may be subject to change.

Keep an eye on the release notes for newer versions and this fix should be included.



I’m running into the same issue - we have issues with query performance that this is exacerbating.

Is a fix in the works?

Nevermind - Adina just let me know in chat that this was fixed in 5.24. We just need to update.