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 C38949DCA0D for ; Wed, 14 Dec 2005 18:47:04 -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 11588-05 for ; Wed, 14 Dec 2005 18:47:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8D83D9DCA1D for ; Wed, 14 Dec 2005 18:47:02 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBEMl3Tw007485; Wed, 14 Dec 2005 17:47:03 -0500 (EST) To: Kevin Brown cc: pgsql-performance@postgresql.org Subject: Re: Simple Join In-reply-to: <200512141603.52583.blargity@gmail.com> References: <200512141603.52583.blargity@gmail.com> Comments: In-reply-to Kevin Brown message dated "Wed, 14 Dec 2005 16:03:52 -0600" Date: Wed, 14 Dec 2005 17:47:03 -0500 Message-ID: <7484.1134600423@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.002 required=5 tests=[AWL=0.002] X-Spam-Score: 0.002 X-Spam-Level: X-Archive-Number: 200512/337 X-Sequence-Number: 16158 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. regards, tom lane