DISTINCTCOUNT and DISTINCTCOUNTHLL aggregations are really slow
See original GitHub issuePinot version used is 0.4.0
Issue: DISTINCTCOUNT on a string column is much much slower than the group by on that same column. DISTINCTCOUNT query:
Select DISTINCTCOUNT(foo) FROM myTable WHERE col1 = 'value1' AND time_col >= 1596750994918 AND time_col < 1597960594918 AND foo != 'null' limit 1
group by query
Select foo, COUNT(*) FROM myTable WHERE col1 = 'value1' AND time_col >= 1596750994918 AND time_col < 1597960594918 AND foo != 'null' group by foo limit 10000
We don’t have an index on column foo
. The DISTINCTCOUNT query was taking anywhere b/w 3 and 6s while the group by query returns in <500ms most of the time. DISTINCTCOUNTHLL was equally slower, if not more in some cases, than DISTINCTCOUNT query.
cc @kishoreg
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
DISTINCTCOUNT and DISTINCTCOUNTHLL aggregations ...
Issue: DISTINCTCOUNT on a string column is much much slower than the group by on that same column. DISTINCTCOUNT query: Select DISTINCTCOUNT(foo) ...
Read more >[GitHub] [incubator-pinot] kishoreg commented on issue #5907 ...
[GitHub] [incubator-pinot] kishoreg commented on issue #5907: DISTINCTCOUNT and DISTINCTCOUNTHLL aggregations are really slow.
Read more >DAX : Approx Distinct Count
For this blog, I want to share an interesting approach that can potentially speed up slow reports that include a distinct count calculation....
Read more >Slow calculations with DISTINCTCOUNT
And it works perfectly, the outcome is correct, however I have a huge amount of data and DISTINCTCOUNT slows down my calculations a...
Read more >Aggregation Functions - Apache Pinot Docs
Returns the count of distinct values of a column as Integer . When there are too many distinct values, automatically switch to approximate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
one reason might be that group by was using dictionary whereas distinct is not. I think you have fixed this in the recent version.
@buchireddy please update this ticket once you have the new version