Posted on November 5, 2016Categories Databases, TechnologyTags , , ,   Leave a comment on Performance Benefits Of COUNT(*) In SQL

Performance Benefits Of COUNT(*) In SQL

This is something I often come across in code.  Just came across it in our MySLP project today , in fact. SELECT count(id) FROM my_table While the performance impact of that statement in itself is negligible, it does add up.  For most database engines that statement incurs additional overhead as it processes logic related to a specific column containing a specific data type.   Some database engines check if the column is null for EVERY RECORD, for example.   Not a big … Continue reading “Performance Benefits Of COUNT(*) In SQL”