How do I specify/change pre-filled query builder for TimescaleDB?

TL;DR the default values in query builder when clicking “add query” are problematic and I want to be able to specify/change what values get pre-filled in.

I have a TimescaleDB instance which used to be indexed by one time column (received_time) but is now indexed by different time column (source_time). However, the pre-filled query builder continues to populate received_time by default. This is quite problematic, as using a time column which is not the index causes TimescaleDB to search the entire database and cause performance issues and occasionally crashes.

What I would like to do is to be able to change the default values that end up in the Query Builder when I click Add Query. I would also like to know if there is any documentation about how that pre-fill works. I have searched around quite a bit but haven’t found anything about it.

My request seems similar to below thread which has gone unanswered for 5 years, but hoping a fresh post might generate some input.

Note that I am having this issue on both v7.3 and v9.1 (we run multiple Grafana instances but all use the same TimescaleDB instance)

Can you try the provisioning approach of creating tinescaledb based dashboards? Then you have total control of the query

@yosiasz Provisioning does provide full control over existing queries, but if a user creates a new query after provisioning, I don’t think provisioning has any control over what gets filled into the query builder by default? Please correct if I’m wrong.

For clarity, our usage model requires that users be able to build their own queries. We have a huge volume of data across many areas of discipline, so the dashboard development process is very distributed. In other words, the process of creating the dashboards we would want to provision involves widespread query creation by many users. That is where we run into this issue of getting bad data pre-filled into the Query Builder, which in some cases will cause a very large query to be kicked off (if the wrong time col is pre-filled) which can cause performance issues for anyone relying on the backend TimescaleDB because it gets clobbered by this wrong time col query.

1 Like