X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B9F639DC892 for ; Thu, 5 Jan 2006 04:34:11 -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 24450-10 for ; Thu, 5 Jan 2006 04:34:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 5001C9DC882 for ; Thu, 5 Jan 2006 04:34:08 -0400 (AST) Received: (qmail 3691 invoked by uid 500); 5 Jan 2006 08:40:30 -0000 Date: Thu, 5 Jan 2006 02:40:30 -0600 From: Bruno Wolff III To: Tsirkin Evgeny Cc: pgsql-admin@postgresql.org Subject: Re: preventing deadlocks Message-ID: <20060105084030.GA32572@wolff.to> Mail-Followup-To: Bruno Wolff III , Tsirkin Evgeny , pgsql-admin@postgresql.org References: <43B10E07.7010503@mail.jct.ac.il> <20051228202607.GA5194@wolff.to> <20060104003001.GY82560@pervasive.com> <20060105065747.GA17322@wolff.to> <43BCDA17.6070806@mail.jct.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43BCDA17.6070806@mail.jct.ac.il> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.043 required=5 tests=[AWL=0.043] X-Spam-Score: 0.043 X-Spam-Level: X-Archive-Number: 200601/65 X-Sequence-Number: 20153 On Thu, Jan 05, 2006 at 10:34:31 +0200, Tsirkin Evgeny wrote: > > I understand THAT ,I meant why int will give me more performance. Because if you have a bunch of processes sitting around waiting for table locks, the average time to process queries will be higher. If you are already limited by IO throughput or CPU usage this may not be a big deal, but in many cases it will be. > Well i DO have a lot of concurrent queries,that is the whole point. Then you probably want to do what people have been recommending you do. > That does not help me .What i want is : > select 1 from table a where whatever for update; > issuing this should fire a trigger that does: You can't trigger on select statements. So this approach won't workin any case. > select 1 from table counter where a.pkey=counter.ident or something > however this should only be done for select FOR UPDATE! > And i can't know that inside the trigger!