Re: Bulk inserts and usage_count - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: Bulk inserts and usage_count
Date
Msg-id 20070515231548.GZ20707@nasby.net
Whole thread Raw
In response to Bulk inserts and usage_count  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-hackers
On Tue, May 15, 2007 at 04:37:28PM +0100, Heikki Linnakangas wrote:
> While testing the buffer ring patch, I noticed that bulk inserts with 
> both INSERT and COPY pin and unpin the buffer they insert to for every 
> tuple. That means that the usage_count of all those buffers are bumped 
<snip> 
> A fix for COPY will fall naturally out of the buffer ring patch, but not 
> for INSERT.
> 
> A more general fix would be to somehow keep the last insertion page 
> pinned across calls to heap_insert.

ISTR discussion in the past about having things like COPY and INSERT
INTO ... SELECT building entire pages in one shot once they exhaust the
FSM. Not only would it address this issue, but it would probably improve
performance in many ways (less locking and unlocking, ability to
pre-sort before inserting into indexes, fewer calls to FSM, probably a
bunch of other things).
-- 
Jim Nasby                                      decibel@decibel.org
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Not ready for 8.3
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Not ready for 8.3