Improve the generic plan mechanism - Mailing list pgsql-hackers

From Kato, Sho
Subject Improve the generic plan mechanism
Date
Msg-id 25C1C6B2E7BE044889E4FE8643A58BA963E1A8F0@G01JPEXMBKW03
Whole thread Raw
List pgsql-hackers
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
notbe 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
createan 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
additionto 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
necessaryto use bounParams to narrow down the child tables for creating a plan.
 

At first I will try to work from #1.

regards,

Sho Kato



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WIP: Avoid creation of the free space map for small tables
Next
From: Amit Langote
Date:
Subject: Re: Fix handling of unlogged tables in FOR ALL TABLES publications