In order to to get fatsre reponse you could shorten you query by just counting one row select count(row) from <table>, or just get the max of the id if u have a regular counter , or just create a row updated with a trigger (on upsdte/insert/delete) that saves the number of rows.
Good Luck !