Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql COUNT Performance Question

Structure of Example table:

Id, Integer (PK)
Name, Varchar(100)
Description, Text

I need to know if exists difference in performance between:

SELECT COUNT(*) FROM Example;

and

SELECT COUNT(Id) FROM Example;

Or does not exists differences?

like image 738
Cesar Avatar asked Sep 22 '26 07:09

Cesar


1 Answers

Differences exist in both performance and the actual resultset

Performance of COUNT SQL function

like image 90
David Hedlund Avatar answered Sep 23 '26 21:09

David Hedlund