horaedb icon indicating copy to clipboard operation
horaedb copied to clipboard

Support show tag values

Open ShiKaiWi opened this issue 2 years ago • 1 comments

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, x column a tag column.

Additional Context

No response

ShiKaiWi avatar Jun 19 '23 02:06 ShiKaiWi

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)) where x has the value index
  • [ ] Compaction support create index file for multiple ssts

ShiKaiWi avatar Jul 25 '23 02:07 ShiKaiWi