Re: partition routing layering in nodeModifyTable.c

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: partition routing layering in nodeModifyTable.c
Date: 2020-10-28 07:46:01
Message-ID: CA+HiwqHpmMjenQqNpMHrhg3DRhqqQfby2RCT1HWVwMin3_5vMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 27, 2020 at 10:23 PM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> This patch looks reasonable to me at a quick glance. I'm a bit worried
> or unhappy about the impact on FDWs, though. It doesn't seem nice that
> the ResultRelInfo is not available in the BeginDirectModify call. It's
> not too bad, the FDW can call ExecGetResultRelation() if it needs it,
> but still. Perhaps it would be better to delay calling
> BeginDirectModify() until the first modification is performed, to avoid
> any initialization overhead there, like establishing the connection in
> postgres_fdw.

Ah, calling BeginDirectModify() itself lazily sounds like a good idea;
see attached updated 0001 to see how that looks. While updating that
patch, I realized that the ForeignScan.resultRelation that we
introduced in 178f2d560d will now be totally useless. :-(

--
Amit Langote
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v2-0001-Call-BeginDirectModify-from-ExecInitModifyTable.patch application/octet-stream 3.8 KB
v2-0002-Initialize-result-relation-information-lazily.patch application/octet-stream 65.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2020-10-28 07:46:31 Re: [HACKERS] Custom compression methods
Previous Message Michael Paquier 2020-10-28 07:43:44 Re: [patch] Fix checksum verification in base backups for zero page headers