Query cache keyed by MonitorQuery

Note:  Only to see the patch
It is mostly the same as last patch