X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 509209DCA3F for ; Tue, 21 Mar 2006 14:23:12 -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 32457-04 for ; Tue, 21 Mar 2006 14:23:10 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 6CCF09DCA0F for ; Tue, 21 Mar 2006 14:23:09 -0400 (AST) Received: from itapoa.terra.com.br (itapoa.terra.com.br [200.176.10.194]) by svr4.postgresql.org (Postfix) with ESMTP id 0ED625AF3A9 for ; Tue, 21 Mar 2006 18:23:09 +0000 (GMT) Received: from ambrose.terra.com.br (ambrose.terra.com.br [200.176.10.10]) by itapoa.terra.com.br (Postfix) with ESMTP id BF17E63465B; Tue, 21 Mar 2006 15:23:05 -0300 (BRT) X-Terra-Karma: -2% X-Terra-Hash: 3c91106f73cb221762789e13d6ad82b4 Received-SPF: pass (ambrose.terra.com.br: domain of terra.com.br designates 200.176.10.10 as permitted sender) client-ip=200.176.10.10; envelope-from=carlosreimer@terra.com.br; helo=reimer; Received: from reimer (unknown [200.101.229.242]) (authenticated user carlosreimer) by ambrose.terra.com.br (Postfix) with ESMTP id A7DA33C1C418; Tue, 21 Mar 2006 15:23:04 -0300 (BRT) Message-ID: <001a01c64d14$80f4a840$8b00000a@reimer> From: "Reimer" To: "Fernando Lujan" , References: <44204107.3040708@mandic.com.br> Subject: Re: Sequence Scan vs. Index scan Date: Tue, 21 Mar 2006 15:23:08 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.919 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.919 X-Spam-Level: * X-Archive-Number: 200603/419 X-Sequence-Number: 17856 Fernando, If you need to read all the table for example it would be better to read only the data pages instead of read data and index pages. Reimer ----- Original Message ----- From: "Fernando Lujan" To: Sent: Tuesday, March 21, 2006 3:08 PM Subject: [PERFORM] Sequence Scan vs. Index scan > Hi guys, > > I'm trying to figure out when Sequence Scan is better than Index Scan. I > just want to know this because I disabled the sequence scan in postgresql > and receive a better result. :) > > Two tables. > > Table 1 (1 million rows ) > ----------- > id > text > table2_id > > Table 2 (300 thousand rows) > ---------- > id > text 2 > > When I join these two tables I have a sequence_scan. :( > > Thanks in advance. > > Fernando Lujan > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend >