understanding insert slowdown - Mailing list pgsql-general

From Thomas O'Dowd
Subject understanding insert slowdown
Date
Msg-id 1033873222.20171.51.camel@beast.uwillsee.com
Whole thread Raw
Responses Re: understanding insert slowdown  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
List pgsql-general
Hi,

Quick, perhaps silly question.

I realise copy from stdin is faster but I'd like to understand the
following scenerio.

transaction = [ 3 x inserts, 2 x simple selects ] x 100
job = 1000 x transactions.

When I start to run this job, it races along for the first couple of
commits taking less than a second, then 3 seconds, then 6, 10 and
finally towards the last couple of transactions around 40 seconds for
the commit.

The job runs at ~100% cpu all the way through, during the commit, vmstat
reports about 65%/35% user/system and during the insert stages 100%
user. There is no swapping and not very much i/o going on.

I tried this with indexes and no indexes and the performance doesn't
vary that much.

Firstly why does this slow down so much from the first couple of
commits? Secondly, what are the tuning options that affect this kind of
thing if any?

Tom.
--
Thomas O'Dowd. - Nooping - http://nooper.com
tom@nooper.com - Testing - http://nooper.co.jp/labs


pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Boolean output format
Next
From: Oleg Bartunov
Date:
Subject: Re: multi-column btree index for real values