X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A57A69DC816 for ; Fri, 6 Jan 2006 16:52:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95653-08 for ; Fri, 6 Jan 2006 16:52:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E31FA9DC84A for ; Fri, 6 Jan 2006 16:52:06 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k06Kq80Z022728; Fri, 6 Jan 2006 15:52:08 -0500 (EST) To: alex-lists-pgsql@yuriev.com cc: pgsql-sql@postgresql.org Subject: Re: INSERT waiting under heavy load In-reply-to: <20060106184227.GA1890@s2.yuriev.com> References: <20060106184227.GA1890@s2.yuriev.com> Comments: In-reply-to alex-lists-pgsql@yuriev.com message dated "Fri, 06 Jan 2006 13:42:27 -0500" Date: Fri, 06 Jan 2006 15:52:08 -0500 Message-ID: <22727.1136580728@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.072 required=5 tests=[AWL=0.072] X-Spam-Score: 0.072 X-Spam-Level: X-Archive-Number: 200601/28 X-Sequence-Number: 23817 alex-lists-pgsql@yuriev.com writes: > After digging through all the discussions of "INSERT waiting" problems I am > still not clear about the concensus about solving it. > ... > The only thing that I do not particulary like is that every INSERT > into this table has to adjust a counter column in a corresponding row of the > (table1) via (table3->table2->table1) path. Well, if there are only a few rows in table1, then this design is inherently going to lose big. Any two transactions trying to update the same table1 row are going to conflict and one will have to wait for the other to complete. Rethink the need for those counters. regards, tom lane