Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 411 Bytes

count-performance.md

File metadata and controls

15 lines (9 loc) · 411 Bytes

Count Performance

The slow performance of COUNT(*) is a thing of the past.

There's really no difference between various COUNT methods. The query planner is smart enough to know what you want to do.

SELECT COUNT(*) FROM my_table;

SELECT COUNT(id) FROM my_table;

SELECT COUNT(1) FROM my_table;

The above queries will result in the same record-counting strategy and will have the same cost.