2009/9/16 Pierre Frédéric Caillaud li...@peufeu.com
OK, that makes sense. I thought you had hacked either XLogInsert or the
heap WAL replay code so that you could just accumulate tuples in the rdata
chain and then submit them all under the cover of a single WALInsertLock.
Ah, no, I did
OK, that makes sense. I thought you had hacked either XLogInsert or the
heap WAL replay code so that you could just accumulate tuples in the
rdata
chain and then submit them all under the cover of a single WALInsertLock.
Ah, no, I did not do that.
This would be difficult to do : rdata
Yes, I did not consider that to be a problem because I did not think it
would be used on indexed tables. I figured that the gain from doing bulk
inserts into the table would be so diluted by the still-bottle-necked
index maintenance that it was OK not to use this optimization for
indexed
Does that heuristic change the timings much? If not, it seems like it
would
better to keep it simple and always do the same thing, like log the
tuples
(if it is done under one WALInsertLock, which I am assuming it is..)
It is the logging of whole pages that makes it faster.
If you fill a
2009/9/15 Pierre Frédéric Caillaud li...@peufeu.com
Does that heuristic change the timings much? If not, it seems like it
would
better to keep it simple and always do the same thing, like log the tuples
(if it is done under one WALInsertLock, which I am assuming it is..)
It is the logging
I've done a little experiment with bulk inserts.
= heap_bulk_insert()
Behaves like heap_insert except it takes an array of tuples (HeapTuple
*tups, int ntups).
- Grabs a page (same as heap_insert)
- While holding exclusive lock, inserts as many tuples as it can on the
page.
-
Replying to myself...
Jeff suggested to build pages in local memory and insert them later in the
table. This is what's used in CLUSTER for instance, I believe.
It has some drawbacks though :
- To insert the tuples in indexes, the tuples need tids, but if you build
the page in local
2009/9/14 Pierre Frédéric Caillaud li...@peufeu.com
I've done a little experiment with bulk inserts.
= heap_bulk_insert()
Behaves like heap_insert except it takes an array of tuples (HeapTuple
*tups, int ntups).
- Grabs a page (same as heap_insert)
- While holding exclusive lock,
2009/9/14 Pierre Frédéric Caillaud li...@peufeu.com
Replying to myself...
Jeff suggested to build pages in local memory and insert them later in the
table. This is what's used in CLUSTER for instance, I believe.
It has some drawbacks though :
- To insert the tuples in indexes, the tuples
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
up to 5. That's gotta be bad if you try to run a COPY concurrently with
other
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
11 matches
Mail list logo