Which one is better – Using mysql aggregate function COUNT to return number of selected occurrence or manually counting and inserting the count into a field during insertion operation? Considering that COUNT function searches the table or an index and groups the result, while in manual counting, I would just retrieve the field.
Share
If you do it manually
Trying to do the work of a DBMS better than a DBMS is not a good idea. A DBMS embodies years and years of experience and optimisations.