Queries with parameters not updating

Hello,

I have chained queries where the primary query fetches data from an external database and returns a “long” table of results and then simple separate queries that return subsets of that based on a dropdown parameter, e.g. SELECT * from cached_query_123 WHERE area = '{{ area }}'. This latter query doesn’t seem to be updating. I have set a refresh schedule of one hour, but the query table doesn’t show a latest execution time at all and dashboards (which have a global parameter) show old data. The query does execute fine if I run it manually or hit the refresh button on the dashboard, but it just doesn’t update in the background and not on dashboard page load either. What’s wrong here? How or why does parametrization affect the updating?

This is on a self-hosted Redash 7 running via Docker.

When you set a schedule for a parameterized query, the scheduler will only execute the query with the default parameter value. This execution won’t be saved in as the latest_query_data_id, but will be available if you open the query.

Does this explain the behavior you see?

What I see is three things:

  1. The list of queries shows “Last Executed At” blank for all parametrized queries
  2. The query itself shows “Updated X hours ago” where X is greater than the defined update schedule
  3. Visualizations on the dashboard also show “(refresh icon) X hours ago” where X is greater than the defined update schedule

Both the query and dashboard have the same default parameter value.

Is latest_query_data_id what the dashboard uses? I’d expect if a user opens a dashboard, the data it shows should be up to date without needing to hit refresh.

We’ve been seeing the same thing. I believe it started when we upgraded to 7.0, but it’s possible it was happening with 6.0 as well. Most of our queries are set to update everyday, but now we have to regularly tell people to hit “Refresh” on dashboards to view updated data. The majority of our queries are also using parameters, we have over 600 queries and 90 dashboards (if this matters). Our main data source is a PostgreSQL database.

From the looks of things, the queries are just not updating at all, going multiple days without running. Looking at the ‘query_results’ table, you don’t see any results either.