X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EA00CD1B18A for ; Tue, 29 Jun 2004 12:22:58 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31532-04 for ; Tue, 29 Jun 2004 15:22:50 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id ED90DD1B182 for ; Tue, 29 Jun 2004 12:22:49 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5TFMmg9029836; Tue, 29 Jun 2004 11:22:49 -0400 (EDT) To: Michal Taborsky Cc: pgsql-performance@postgresql.org Subject: Re: Slow INSERT In-reply-to: <40E1863B.9070208@taborsky.cz> References: <40E160E6.4080105@taborsky.cz> <29095.1088519446@sss.pgh.pa.us> <40E1863B.9070208@taborsky.cz> Comments: In-reply-to Michal Taborsky message dated "Tue, 29 Jun 2004 17:09:47 +0200" Date: Tue, 29 Jun 2004 11:22:48 -0400 Message-ID: <29835.1088522568@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/303 X-Sequence-Number: 7361 Michal Taborsky writes: > I ran some tests to support this hypothesis. Every 500th insert is a tad > slower, but it is insignificant (normally the INSERT lasts 1.5ms, every > 500th is 9ms). During my tests (10 runs of 1000 INSERTS) I had > experienced only one "slow" insert (2000ms). It is clearly caused by > other processes running on this server, but such degradation of > performance is highly suspicious, because the server very rarely goes > over load 1.0. Actually, the simpler theory is that the slowdown is caused by background checkpoint operations. Now a checkpoint would slow *everything* down not only this one insert, so maybe that's not the right answer either, but it's my next idea. You could check this to some extent by manually issuing a CHECKPOINT command and seeing if you get an insert hiccup. Note though that closely spaced checkpoints will have less effect, because less I/O will be triggered when not much has changed since the last one. So you'd want to wait a bit between experiments. regards, tom lane