pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Brown <blargity@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Simple Join
Date: Wed, 14 Dec 2005 17:47:03 -0500
Message-ID: <7484.1134600423@sss.pgh.pa.us> (raw)
In-Reply-To: <200512141603.52583.blargity@gmail.com>
References: <200512141603.52583.blargity@gmail.com>

Kevin Brown <blargity@gmail.com> 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



view thread (19+ messages)  latest in thread

Message-ID: <7484.1134600423@sss.pgh.pa.us>
Permalink:  ../7484.1134600423@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7484.1134600423@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, blargity@gmail.com
  Subject: Re: Simple Join
  In-Reply-To: <7484.1134600423@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox