X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1948D9FA4CF for ; Wed, 13 Sep 2006 15:39:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 72339-03 for ; Wed, 13 Sep 2006 15:39:28 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.236]) by postgresql.org (Postfix) with ESMTP id EAF3E9FA1E2 for ; Wed, 13 Sep 2006 15:39:28 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id i21so785697wra for ; Wed, 13 Sep 2006 11:39:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:from:to:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=A+PCKw8UNDKaiYAJnm5l1XvtwhZZFgmtVxqZfoWrBE7Hzja3w4KnNA+hrQnS4ofZU0BFCmgmCnpt9sHFP7a5uBIbYv6iPJuhqa8Vilc4eNKk/WY/ahaM4aUeOrhoE/CMKUyEaq6OS/F1hNol+t7NAAvcZinxvOlJ181s3RJpddA= Received: by 10.65.251.1 with SMTP id d1mr6038801qbs; Wed, 13 Sep 2006 11:39:27 -0700 (PDT) Received: from maniek ( [81.219.252.2]) by mx.gmail.com with ESMTP id a29sm6944570qbd.2006.09.13.11.39.25; Wed, 13 Sep 2006 11:39:26 -0700 (PDT) Message-ID: <031701c6d764$05b0c490$0c67a8c0@maniek> From: "Marcin Mank" To: "Joshua Marsh" , References: <38242de90609121517y62517040v8622b9ae93cba23d@mail.gmail.com> Subject: Re: Performance With Joins on Large Tables Date: Wed, 13 Sep 2006 20:39:59 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.431 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/126 X-Sequence-Number: 20812 > Is there anything I'm missing that is preventing it from using the index? It > just seems weird to me that other joins like this work fine and fast > with indexes, > but this one won't. Did You consider clustering both tables on the dsiacctno index? I just checked that for a 4M rows table even with enable_seqscan=on and default *page_cost on PG 8.1.4 an index scan is being chosen for select * from table order by serial_pkey_field This is essentially the question in Your case - sort it, or get it sorted via the index at the expense of more random IO. I think clustering should work for You, but I am no expert, check with others. Greetings Marcin