Is there a faster method to get the record number of a huge mysql table (~3 mil rows) ?
I don't want to list them, only to get the total.
Thanks
Is there a faster method to get the record number of a huge mysql table (~3 mil rows) ?
I don't want to list them, only to get the total.
Thanks
SELECT COUNT(id) AS total FROM table;
SELECT COUNT(id) FROM tbl;
If "id" is an index this should be pretty fast.
If you use a WHERE too, the index has to be a covering index (contain all rows in one index)
You could just say:
SELECT COUNT(*) FROM TABLE;
That should display the number of records in the table.