I have a table which is frequently updated (insert/delete). I also have a script to periodically count how many records are stored in the table. How can I optimize the performance?
- Do nothing: Just use the COUNT function.
- Create another field to store the number of records: Whenever a new record's added, we increase that field and vice versa.