I wonder if your solution to Problem 1 transferred the work from select to trigger and possibly even more so. What I mean is the total time it takes to maintain the count using a trigger may be more than doing a total recount once in a while.
Is there a way to fetch an approximate number of rows? It maintains the stats somewhere.
I agree, but the reason to prefer a trigger over count is that, if the count occurs all the time, it's better to take a hit in terms of triggers, rather than having a slower performance on every read.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I wonder if your solution to Problem 1 transferred the work from select to trigger and possibly even more so. What I mean is the total time it takes to maintain the count using a trigger may be more than doing a total recount once in a while.
Is there a way to fetch an approximate number of rows? It maintains the stats somewhere.
I agree, but the reason to prefer a trigger over count is that, if the count occurs all the time, it's better to take a hit in terms of triggers, rather than having a slower performance on every read.