Fix shadowing issues with aggregation in Ronja

Signed-off-by: Stefan Plantikow <stefan.plantikow@neotechnology.com>
Only hit prepared query cache when planning (avoid extra lookup)

signed-off-by: Jakub Wieczorek <jakub.wieczorek@neotechnology.com>
Merge pull request #2717 from jakub-/ronja-aggregation

Fix shadowing issues with aggregation in Ronja