Do all the counts ahead of time and just remember them? In a separate "counts" table?
You would presumably only need to update them when a product or product variant was added, no?
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.