understanding insert slowdown

From: Thomas O'Dowd <tom(at)nooper(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: understanding insert slowdown
Date: 2002-10-06 03:00:22
Message-ID: 1033873222.20171.51.camel@beast.uwillsee.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)nooper(dot)com - Testing - http://nooper.co.jp/labs

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nikolaus Dilger 2002-10-06 03:17:38 Re: [ADMIN] Fast Deletion For Large Tables
Previous Message Jeff Davis 2002-10-06 01:50:00 Re: Boolean output format