Reputation: 83
I am currently trying to formulate a better query than what I currently have at the moment. For analysis reasons, I want to see the different combinations of facets a certain record has. Currently I use SELECT COUNT(myRecord)FROM Metric FACET foo, bar
. This does the job, but I am wondering if it is possible to aggregate the data more efficiently. I use COUNT to group the values together, but I ultimately do not care about the COUNTed sum. Is there a better way to write this query that does not perform that additional calculation?
Upvotes: 0
Views: 4750
Reputation: 21
I think that uniques might be what you're looking for?
Use the uniques() function to return a list of unique values recorded for an attribute over the time range specified.
For example, based on your current query you could get unique combinations of foo
and bar
without the count(s) by using this query:
SELECT uniques(tuple(foo, bar)) FROM Metric
Upvotes: 2