3 ms·
Never do SELECT * when counting rows, SELECT(UIDPK) primary key for example instead.
by acd 6y ago
Never do SELECT * when counting rows, SELECT(UIDPK) primary key for example instead.
- jeltz 6y agoWhy? SELECT count(*) does not actually mean fetching all fields. It actually means fetching zero fields (the SQL standard is a bit weird) while SELECT count(uidpk) means fetching one field, but some databases optimize that to SELECT count(*) if uidpk is NOT NULL.