On Wed, 2021-02-03 at 10:54 +0100, Karsten Hilbert wrote: > > I just ran a few practical tests on large (~14mil rows) tables that have > > multiple indexes. > > SELECT COUNT(id) forces PostgreSQL to use the primary key index. > > SELECT COUNT(*) allows PostgreSQL to chose an index to use and it seems to > > be choosing one of smaller size which leads to less IO and hence returns > > the result faster. > > Would you mind throwing in a test for > > select count(1) ... No need to test. That will be slightly slower because it repeatedly checks if 1 is NULL or not. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com