Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not re-fetch table metada on adding a new filter #415

Open
mshustov opened this issue Jun 4, 2023 · 3 comments
Open

Do not re-fetch table metada on adding a new filter #415

mshustov opened this issue Jun 4, 2023 · 3 comments

Comments

@mshustov
Copy link
Collaborator

mshustov commented Jun 4, 2023

What happened:
Whenever I add an ad-hoc filter for a panel, the plugin makes a request SELECT name, type, table FROM system.columns, which adds a few sec. delay.

What you expected to happen:
Do not fetch definitions again, if the plugin already has the necessary data.

How to reproduce it (as minimally and precisely as possible):

  1. Crete a panel
  2. add an ad-hoc filter variable
  3. add a filter
  4. add another filter

Screenshots
2023-06-04_14-45-28

Environment:

  • Grafana version: main branch
  • Plugin version: v3.1.0
@mshustov mshustov added type/bug Something isn't working datasource/ClickHouse labels Jun 4, 2023
@aangelisc
Copy link
Contributor

Hi @mshustov, thank you for opening this. I'm unsure this is a bug, how can we be certain that the schema hasn't changed in between the filters being added? If a datasource is left open for awhile that could be enough time for the schema to change and those changes would not be reflected in the options.

@mshustov
Copy link
Collaborator Author

how can we be certain that the schema hasn't changed in between the filters being added? If a datasource is left open for awhile that could be enough time for the schema to change and those changes would not be reflected in the options.

The plugin can implement time-based or any other caching policy. I don't think the plugin re-fetches data on Expore view for example, and it provides a way better UX.

@bossinc
Copy link
Collaborator

bossinc commented Sep 1, 2023

I think it makes sense to cache the schema for the session on the frontend. It would make a better user experience

@aangelisc aangelisc added enhancement New feature or request and removed type/bug Something isn't working labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Feature Requests
Development

No branches or pull requests

3 participants