horaedb
horaedb copied to clipboard
Support show tag values
Describe This Problem
Currently, count(distinct(x)) is the only choice to fetch all the values of a tag, which requires scanning all the ssts and takes lots of time. However, this should be a very light-weight query for time series database, e.g. grafana shows suggestions about a specific label.
Proposal
- Record all the values for a tag if possible;
- Do fast query when
count(distinct(x))is performed on a tag column, that is to say,xcolumn a tag column.
Additional Context
No response
This is a huge task, I'll split it into these sub-tasks:
- [ ] Support separate index file for the column values
- [ ] Table options for supporting configure value index on specific column
- [ ] Query optimize rule for
count(distinct(x))wherexhas the value index - [ ] Compaction support create index file for multiple ssts