Performance and query plans for
count distinct :
Truly, the gauntlet had been thrown, and we are here to answer. We ran the
queries on Postgres 9.3, MySQL 5.6, SQL Server 2012 SE 11.0, and Oracle SE1
Interestingly, but quite expected, the query plans for queries in SQL Server and Oracle were identical. What’s intriguing is how with a more “naïve” query plan, they both outperformed MySQL and PostgreSQL.
Original title and link: Count Distinct Compared on Top 4 SQL Databases