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 571119DCA18 for ; Wed, 14 Dec 2005 19:18:27 -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 19505-07 for ; Wed, 14 Dec 2005 19:18:28 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by postgresql.org (Postfix) with ESMTP id 7B9789DCA28 for ; Wed, 14 Dec 2005 19:18:24 -0400 (AST) Received: by wproxy.gmail.com with SMTP id 69so502591wri for ; Wed, 14 Dec 2005 15:18:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:cc:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=dGgVHgQOsWhDa7fE7J7TlUAmQZ9Dvjcg/9P8NqhnItKeLosD1zPSJcCHxOcQxgmXZtFRAG5Qus69KOA6A8GvnYwfl6Cks83RK2RlSvJByO5BzYWA8MdAFhteHu5mqcNXOI9WHR6nfLtQ3SfoM91s/N1E3AejQu80h2f3HaOc0LY= Received: by 10.54.125.7 with SMTP id x7mr1283841wrc; Wed, 14 Dec 2005 15:18:26 -0800 (PST) Received: from ?192.168.1.100? ( [67.44.112.218]) by mx.gmail.com with ESMTP id 35sm2568994wra.2005.12.14.15.18.07; Wed, 14 Dec 2005 15:18:26 -0800 (PST) From: Kevin Brown To: Tom Lane Subject: Re: Simple Join Date: Wed, 14 Dec 2005 17:12:56 -0600 User-Agent: KMail/1.8 References: <200512141603.52583.blargity@gmail.com> <7484.1134600423@sss.pgh.pa.us> In-Reply-To: <7484.1134600423@sss.pgh.pa.us> Cc: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512141712.56919.blargity@gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/338 X-Sequence-Number: 16159 On Wednesday 14 December 2005 16:47, you wrote: > Kevin Brown writes: > > I'm running 8.1 installed from source on a Debian Sarge server. I have a > > simple query that I believe I've placed the indexes correctly for, and I > > still end up with a seq scan. It makes sense, kinda, but it should be > > able to use the index to gather the right values. > > I continue to marvel at how many people think that if it's not using an > index it must ipso facto be a bad plan ... > > That plan looks perfectly fine to me. You could try forcing some other > choices by fooling with the planner enable switches (eg set > enable_seqscan = off) but I doubt you'll find much improvement. There > are too many rows being pulled from ordered_products to make an index > nestloop a good idea. That's fine, so being a postgres novice, as I stated in my original post, what would be the best way to improve performance? Redundant column that's updated via a trigger? I'm asking this list because I'd like to do it right, as opposed to get it done. > regards, tom lane