Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2DDE4475CEE for ; Thu, 16 Jan 2003 10:50:03 -0500 (EST) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by postgresql.org (Postfix) with ESMTP id 5503C4767C0 for ; Thu, 16 Jan 2003 10:50:00 -0500 (EST) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030116155005.KTXQ8666.lakemtao03.cox.net@[192.168.1.1]> for ; Thu, 16 Jan 2003 10:50:05 -0500 Subject: Re: schema/db design wrt performance From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <20030116103933.B32288@mail.libertyrms.com> References: <20030116135140.32097.qmail@web21106.mail.yahoo.com> <20030116092005.C22344@mail.libertyrms.com> <1042727678.892.31.camel@haggis> <20030116103933.B32288@mail.libertyrms.com> Content-Type: text/plain Organization: Message-Id: <1042732204.892.35.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 16 Jan 2003 09:50:04 -0600 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/150 X-Sequence-Number: 797 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? -- +------------------------------------------------------------+ | Ron Johnson, Jr. mailto:ron.l.johnson@cox.net | | Jefferson, LA USA http://members.cox.net/ron.l.johnson | | | | "Basically, I got on the plane with a bomb. Basically, I | | tried to ignite it. Basically, yeah, I intended to damage | | the plane." | | RICHARD REID, who tried to blow up American Airlines | | Flight 63 | +------------------------------------------------------------+