When you use a column name instead of *, SQL will return all the rows where the value of the column name is not NULL. That count may be less than the actual count of rows in a DB. In the specific case of SQLite, rowid may not be NULL and therefore return the correct number of rows. But instead of guessing if a certain column has NULL values or not, one can always use *.
. Using a declared column is even slower than both.
The difference is microscopic and they are both very fast. But it was an unexpected finding. It goes to show, you should always test your speculations.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.