Hi, hackers

I want to improve the generic plan mechanism and speed up the UPDATE/DELETE 
planning of a table partitioned into thousands.
However, I am not sure if this is realistic, I would like advice.

The current generic plan creates access plans for all child tables without 
using the parameters specified in EXECUTE.
Also, inheritance_planner() creates access plans for all child tables after 
copying the RTEs of the parent to subroot.

As mentioned above, I think it is wasteful to create access plans for all child 
tables including child tables that may not be accessed in EXECUTE.
Therefore, instead of creating an access plan for all child tables at one time, 
I think that it would be better to create an access plan for the child table at 
the time of EXECUTE execution and add it to the cached plans (plans of 
ModifyTable).

According to my research, I know that there are two issues.

#1 How to add a partially created plan to an existing cached plan
#2 Which child table plan to create

#1
In order to partially create a plan, it is necessary to consider which 
information is cached to create a plan in addition to the plan cache.
Also, it is necessary to consider how to manage cached plans.

#2
If a parameter of EXEXUTE is specified in boundParams of pg_queries(), a custom 
plan will be created, so it is necessary to use bounParams to narrow down the 
child tables for creating a plan.

At first I will try to work from #1.

regards,

Sho Kato


Reply via email to