QueryPlan
No edit summary
No edit summary
Line 17: Line 17:


If your View is not a seeker in any form - the data is already fetched and QueryPlan should discover that no unseen objects are requested - and thus no fetch is needed
If your View is not a seeker in any form - the data is already fetched and QueryPlan should discover that no unseen objects are requested - and thus no fetch is needed
Keywords: Query optimizer, Query planner, optimise, view model optimiser

Revision as of 08:29, 10 May 2022

QueryPlan is what we call the ability to statically analyze a viewmodel to know ahead of time what data it will use.

QueryPlan is used to efficiently fetch the data for a view.

Since views may shift what data they show (seekers or when base nesting on variables) the QueryPlan logic is active even after view creation - to make sure the slow performing lazy fetch does not kick in.

Lazy fetch is a strategy to fetch the object needed for a object locator just in time. This is practical but if every object would fetch itself with a roundtrip to server the application would not scale at all.

QueryPlan has multiple steps:

  1. Statically figure out Hierarcy building expressions (the nestings). On this level we only collect Class and Relation + the classes that expressions used the allinstances operator on
  2. Statically figure out what the other columns use (the non nestings)

From these 2 steps we have static information about what TYPE of information that will - at one point or another - be used by the view - per hierarcy level

QueryPlan place subscription on all vCurrent variables for Nesting levels. Whenever a vCurrent variable is shifted it may be an opportunity for QueryPlan to efficiently fetch data below this point.

This happens for example is seekers - when user has a new list of objects - and the selected object may be root to show details. In this case QueryPlan will kick in and efficiently fetch such details for the selected object.

If your View is not a seeker in any form - the data is already fetched and QueryPlan should discover that no unseen objects are requested - and thus no fetch is needed

Keywords: Query optimizer, Query planner, optimise, view model optimiser

This page was edited 3 days ago on 03/26/2024. What links here