This is a quite lucky edge case; in order for this to work, you need to have the underlying tables (5 in this case) change infrequently.
This is actually, directly and indirectly, the core issue of query caches.
The one mentioned is the direct problem; the indirect one is that for each record change in any table [present in the query cache], the entire query cache must scanned and invalidated, which causes locking.
This is actually, directly and indirectly, the core issue of query caches.
The one mentioned is the direct problem; the indirect one is that for each record change in any table [present in the query cache], the entire query cache must scanned and invalidated, which causes locking.