If you need to invalidate this "cache", it's extremely expensive to find the records that need updating. It's probably better to use a summary table that's populated with triggers, or to just optimize your indexes and use a JOIN (the world won't end, I promise).
If you need to invalidate this "cache", it's extremely expensive to find the records that need updating. It's probably better to use a summary table that's populated with triggers, or to just optimize your indexes and use a JOIN (the world won't end, I promise).