3 ms·
Use Subqueries to Count Distinct 50X Faster
- nextw33k 13y agoThis 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 13y agohttps://news.ycombinator.com/item?id=7114310 https://news.ycombinator.com/item?id=7114310