

Use Subqueries to Count Distinct 50X Faster - hglaser
https://www.periscope.io/blog/use-subqueries-to-count-distinct-50x-faster.html

======
nextw33k
This to me is a bug and should be reported as such. If I can write a query in
three different ways and get three different durations with the same data
returned then the query engine isn't optimizing the steps correctly.

As SQL developers we should be abstracted away from performance considerations
as the database engine (and its developers) should know better than us how to
optimize data retrieval. I find selecting indexes to be a 90s hang up that we
haven't yet let go of.

------
pella
[https://news.ycombinator.com/item?id=7114310](https://news.ycombinator.com/item?id=7114310)

