It's diffrerent from mysql
I know we can use show tag values to do the same thing but we may query very more times
A current workaround for this is to trick the system using subqueries. You just need to choose a known field and do this:
SELECT count(distinct(host)) FROM (SELECT value, host FROM cpu)
Not as performant as an ideal solution, but it works.
This would be awesome, to be honest :heart:
@jsternberg it works,thx
we may make the tag be a redundancy field.it may waste some storage but the performance may be good
This would be extremely useful. I often have a need to visualize the number of rows that match certain criteria (e.g. in Grafana). I'm using the workaround suggested by @jsternberg , but it would be nice if this were baked into a real feature of the language.
SHOW TAG VALUES CARDINALITY FROM memcached WITH KEY = "host" WHERE environment =~ /^$country$/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
Most helpful comment
A current workaround for this is to trick the system using subqueries. You just need to choose a known field and do this:
Not as performant as an ideal solution, but it works.