Added result cache for root ($) queries performed by predicates.