Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 25C9847675C for ; Thu, 16 Jan 2003 11:04:36 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 82518476D75 for ; Thu, 16 Jan 2003 11:02:35 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 24504D606; Thu, 16 Jan 2003 08:02:40 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 1A04C5C02; Thu, 16 Jan 2003 08:02:40 -0800 (PST) Date: Thu, 16 Jan 2003 08:02:40 -0800 (PST) From: Stephan Szabo To: Ron Johnson Cc: PgSQL Performance ML Subject: Re: schema/db design wrt performance In-Reply-To: <1042732204.892.35.camel@haggis> Message-ID: <20030116080132.A4962-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/152 X-Sequence-Number: 799 On 16 Jan 2003, Ron Johnson wrote: > On Thu, 2003-01-16 at 09:39, Andrew Sullivan wrote: > > On Thu, Jan 16, 2003 at 08:34:38AM -0600, Ron Johnson wrote: > > > On Thu, 2003-01-16 at 08:20, Andrew Sullivan wrote: > > > > > > If a user has multiple connections and charges things to the same > > > > account in more than one connection at the same time, the > > > > transactions will have to be processed, effectively, in series: each > > > > one will have to wait for another to commit in order to complete. > > > > > > This is true even though the default transaction mode is > > > READ COMMITTED? > > > > Yes. Remember, _both_ of these are doing SELECT. . .FOR UPDATE. > > Which means they both try to lock the corresponding record. But they > > can't _both_ lock the same record; that's what the lock prevents. > > Could BEFORE INSERT|UPDATE|DELETE triggers perform the same > functionality while touching only the desired records, thus > decreasing conflict? It does limit it to the corresponding records, but if you say insert a row pointing at customer 1, and in another transaction insert a row pointing at customer 1, the second waits on the first.