so I executed this query on a table:
EXPLAIN SELECT COUNT(*) FROM table;
and the ‘rows’ column from the output is displayed as NULL (whereas usually it will show how many rows the query went through)…
does this mean that the COUNT command is instantaneous and therefore does not require going through any row whatsoever?
If your table uses the
MyISAMstorage engine, then yes, that query resolves in constant time. The row count is part of the table metadata, the table itself does not have to be examined.