X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3299BD1B475 for ; Fri, 5 Dec 2003 10:08:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 23188-03 for ; Fri, 5 Dec 2003 06:08:29 -0400 (AST) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id 4699BD1B47A for ; Fri, 5 Dec 2003 06:08:22 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 3.35 #1) id 1ASCsp-00003O-0V; Fri, 05 Dec 2003 10:08:23 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id 0AD5716A42; Fri, 5 Dec 2003 10:08:21 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 3462315948; Fri, 5 Dec 2003 10:08:20 +0000 (GMT) From: Richard Huxton To: Ivar Zarans , pgsql-performance@postgresql.org Subject: Re: Slow UPADTE, compared to INSERT Date: Fri, 5 Dec 2003 10:08:20 +0000 User-Agent: KMail/1.5 References: <20031204185751.GA15893@alcaron.ee> <20031205014514.GA21079@alcaron.ee> <20031205020728.GA21440@alcaron.ee> In-Reply-To: <20031205020728.GA21440@alcaron.ee> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312051008.20317.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/120 X-Sequence-Number: 4980 On Friday 05 December 2003 02:07, Ivar Zarans wrote: > I have played around with explain and explain analyze and noticed one > interesting oddity: [snip] > Why first example, where recid is given as numeric constant, is using > sequential scan, but second example, where recid is given as string > constant works with index scan, as expected? Third example shows, that > numeric constant must be typecasted in order to function properly. > > Is this normal behaviour of fields with bigint type? As Christopher says, normal (albeit irritating). Not sure it applies here - all the examples you've shown me are using the index. Well - I must admit I'm stumped. Unless you have a *lot* of indexes and foreign keys to check, I can't see why it would take so long to update a single row. Can you post the schema for the table? -- Richard Huxton Archonet Ltd