Re: Inserting heap tuples in bulk in COPY - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Inserting heap tuples in bulk in COPY
Date
Msg-id 4EA57A3D.5050509@enterprisedb.com
Whole thread Raw
In response to Re: Inserting heap tuples in bulk in COPY  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Inserting heap tuples in bulk in COPY  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On 25.09.2011 16:03, Dean Rasheed wrote:
> On 25 September 2011 09:43, Kohei KaiGai<kaigai@kaigai.gr.jp>  wrote:
>> Hi Heikki,
>>
>> I checked your patch, then I have a comment and two questions here.
>>
>> 2011/9/14 Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>:
>>>
>>> Attached is a new version of the patch. It is now complete, including WAL
>>> replay code.
>
> Hi,
>
> I had a quick look at the patch as well and spotted an oversight: the
> multi-insert code branch fails to invoke AFTER ROW triggers.

Thanks! Here's an updated version of the patch, fixing that, and all the
other issues pointed out this far.

I extracted the code that sets oid and tuple headers, and invokes the
toaster, into a new function that's shared by heap_insert() and
heap_multi_insert(). Tom objected to merging heap_insert() and
heap_multi_insert() into one complicated function, and I think he was
right on that, but sharing this code to prepare a tuple still makes
sense. IMHO it makes heap_insert() slightly more readable too.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] Use new oom_score_adj without a new compile-time constant
Next
From: "Kevin Grittner"
Date:
Subject: Re: So, is COUNT(*) fast now?