Reusing SQL results

I started using looker recently. I have a dashboard which has several looks. The data for the looks come from a single view that I created in looker which is many columns. Each look has related data or data that should be represented together. Everything works good but the issue that I have is that for every look on the dashboard same query gets executed even though the query is almost identical. The reason I am saying almost identical is that for each look, looker executes the query and simply selects only the columns that are there in that look. What I am looking at is a way so that my view/query gets executed only once and gets all columns and then I use needed columns in different looks.


33 replies

Userlevel 7
Badge +1

I actually can’t get it to not work no matter what I tweak.

I think you should work with support a bit more on this one since they have direct access to your instance and I’m just shootin’ in the dark!

Hi @izzy just noting some investigation I did here. I did notice I was also getting identical queries being sent with the same:

  • query hash

  • query ID

  • render key

  • result source=query

but with different:

  • history ID

  • history slug

Note for my case I’m using derived tables, spark, and 3 duplicates/identical tiles containing merges in them (no visualization changes either) on the same dashboard with identical filters. I ran a diff from the SQL tab from the individual queries in the /queries page and they were identical as well

I can confirm from the spark web UI seeing multiple queries as well with identical instance slugs but different history IDs

For your case above, I was wondering if you were using DT/PDTs or merge tiles at all?

Here’s a screenshot of /queries and the history lookup from usage tables like you had a few posts up

Userlevel 7
Badge +1

So these are truly identical tiles, it seems. That’s funky, and I wonder if it has to do with Spark— Or rather, our connection to Spark. I don’t have a Spark connection laying around myself, so for troubleshooting this you’d be best served to reach out to support. I’d be super clear about the fact that these tiles are literally identical.

I feel fairly sure that this shouldn’t be happening, and that it doesn’t happen in all the tests I’ve done on other dialects.

This is a great hack. I was able to successfully deploy this strategy to old dashboards. But I’ve just noticed this doesn’t work on the new generation of dashboards :(

I have already raised with DCL team and hopefully we’ll be able to use it soon. 

maybe it would be useful if people stopped making things up on tech forums.

in sum, there’s this really obvious flaw with looker, that loads of people have searched about, and is summarised by alex hancock’s comment on this thread from 3 years ago

Userlevel 6

I still dont know if this is true or not as I haven’t bothered checking but this may be of some help:


Userlevel 4


Maybe worth mentionning this as well: this is one of the most common use case where you build a dashboad with multiple single values and  composing a single query with show/hide options. In that case,  there was a bug and multiple queries were sent totthe DB, see latest relnotes:

If a dashboard had two tiles that had the same queries/SQL but that were hiding different fields from visualization, two queries with the same SQL were sent to the database instead of just one. This behavior has been corrected.


Finally! :)