Improve the generic plan mechanism

From: "Kato, Sho" <kato-sho(at)jp(dot)fujitsu(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Improve the generic plan mechanism
Date: 2019-03-14 06:21:19
Message-ID: 25C1C6B2E7BE044889E4FE8643A58BA963E1A8F0@G01JPEXMBKW03
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-03-14 06:31:03 Re: Fix handling of unlogged tables in FOR ALL TABLES publications
Previous Message Amit Kapila 2019-03-14 06:17:29 Re: WIP: Avoid creation of the free space map for small tables