Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 38F9F9FA304 for ; Wed, 13 Dec 2006 07:35:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 51242-08 for ; Wed, 13 Dec 2006 07:35:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from serveurmail01.codata.be (125.123.146.82.ipv4.evonet.be [82.146.123.125]) by postgresql.org (Postfix) with ESMTP id D6C0D9FA0EF for ; Wed, 13 Dec 2006 07:35:08 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 923E4183877C; Wed, 13 Dec 2006 12:35:07 +0100 (CET) X-DSPAM-Result: Innocent X-DSPAM-Processed: Wed Dec 13 12:35:05 2006 X-DSPAM-Confidence: 0.6198 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 457fe569136468580015791 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at Received: from serveurmail01.codata.be ([127.0.0.1]) by localhost (serveurmail01.codata.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IF1AXH+Rd2C7; Wed, 13 Dec 2006 12:35:05 +0100 (CET) Received: from [127.0.0.1] (38-179-112-217.fix.adsl.belcenter.be [217.112.179.38]) by serveurmail01.codata.be (Postfix) with ESMTP id 65BEE1838779; Wed, 13 Dec 2006 12:35:05 +0100 (CET) Message-ID: <457FE568.8010302@freesurf.fr> Date: Wed, 13 Dec 2006 12:35:04 +0100 From: Arnaud Lesauvage User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Ragnar CC: pgsql-performance@postgresql.org Subject: Re: Slow update with simple query References: <457FDB1E.6040801@freesurf.fr> <1166008803.6369.94.camel@localhost.localdomain> In-Reply-To: <1166008803.6369.94.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 0657-2, 12/12/2006), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/315 X-Sequence-Number: 22371 Ragnar a écrit : >> Do you think the problem is with the indexes ? > > I guess so. are you sure about the index on t1.uid? > what are the column definitions for t1.uid and t2.uid ? > are they the same ? Man, no !!! I just checked and indeed, no index on this column. I probably dropped it lately. Thanks Ragnar. (t1.uid and t2.uid were the same, character(32) columns) > you should ba able to get a plan similar to: > Merge Join (cost=0.00..43.56 rows=1000 width=11) > Merge Cond: ("outer".uid = "inner".uid) > -> Index Scan using t1i on t1 (cost=0.00..38298.39 rows=2000035 > width=10) > -> Index Scan using t2i on t2 (cost=0.00..26.73 rows=1000 width=5) > > what postgres version are you using ? Ooops, forgot that too : 8.1.4 I am creating the index right now, I'll tell you if this fixes the problem. Thanks for your help ! -- Arnaud