X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 236E15E46D9 for ; Fri, 20 Aug 2004 13:34:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84696-07 for ; Fri, 20 Aug 2004 16:34:52 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 334F95E46CF for ; Fri, 20 Aug 2004 13:34:43 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i7KGYmpE022879; Fri, 20 Aug 2004 12:34:48 -0400 (EDT) To: dmota@nexen.com.br Cc: pgsql-performance@postgresql.org Subject: Re: Query performance problem In-reply-to: <002201c486d2$4fbe4420$8afea8c0@nexen.lan> References: <002201c486d2$4fbe4420$8afea8c0@nexen.lan> Comments: In-reply-to "Danilo Mota" message dated "Fri, 20 Aug 2004 13:25:30 -0300" Date: Fri, 20 Aug 2004 12:34:48 -0400 Message-ID: <22878.1093019688@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/305 X-Sequence-Number: 7941 "Danilo Mota" writes: > SELECT > rc.pkcliente > FROM r_cliente AS rc > INNER JOIN sav_cliente_lg AS sc ON sc.cpfcnpj = sc.cpfcnpj; Surely you meant INNER JOIN sav_cliente_lg AS sc ON rc.cpfcnpj = sc.cpfcnpj; I would also venture that your statistics are desperately out of date, because if the planner's estimates are close to reality, even this unconstrained-cross-product join shouldn't have taken that long. regards, tom lane