sql >> Database >  >> RDS >> PostgreSQL

postgresql COUNT (DISTINCT ...) erg traag

U kunt dit gebruiken:

SELECT COUNT(*) FROM (SELECT DISTINCT column_name FROM table_name) AS temp;

Dit is veel sneller dan:

COUNT(DISTINCT column_name)


  1. De Adaptive Join Threshold

  2. Equivalent van strftime in Postgres

  3. Update meerdere kolommen in SQL

  4. Quickbooks ODBC-stuurprogramma