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 EF91D3A6D8D for ; Sat, 11 Dec 2004 02:57:04 +0000 (GMT) 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 82823-10 for ; Sat, 11 Dec 2004 02:56:28 +0000 (GMT) Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by svr1.postgresql.org (Postfix) with ESMTP id B49DA3AA5BC for ; Sat, 11 Dec 2004 01:46:21 +0000 (GMT) Received: from [2001:700:300:dc03:20e:cff:fe36:a766] (helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtp (Exim 4.34) id 1CcwKR-0002ve-L5 for pgsql-performance@postgresql.org; Sat, 11 Dec 2004 02:46:20 +0100 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1CcwK8-0004bC-00 for ; Sat, 11 Dec 2004 02:45:28 +0100 Date: Sat, 11 Dec 2004 02:45:28 +0100 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: Slow insert Message-ID: <20041211014528.GA16264@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <41B66A0B.1090003@familyhealth.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41B66A0B.1090003@familyhealth.com.au> X-Operating-System: Linux 2.6.8.1 on a i686 User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/143 X-Sequence-Number: 9518 On Wed, Dec 08, 2004 at 10:42:19AM +0800, Christopher Kings-Lynne wrote: > Why would an INSERT ever be really slow? This is what I see a lot of in > our site logs: > > Dec 5 15:57:48 marshall postgres[19599]: [3-1] LOG: duration: > 13265.492 ms statement: INSERT INTO users_sessions (sid, cobrand_id, > uid) VALUES ('145982ac39e1d09fec99cc8a606155e7', '1', '0') > > 13 seconds to insert a single row! Do you have a foreign key or other check which could be really slow? /* Steinar */ -- Homepage: http://www.sesse.net/