pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeremy Haile <jhaile@fastmail.fm>
Cc: pgsql-performance@postgresql.org
Subject: Re: PG8.2.1 choosing slow seqscan over idx scan
Date: Tue, 16 Jan 2007 16:39:07 -0500
Message-ID: <26412.1168983547@sss.pgh.pa.us> (raw)
In-Reply-To: <1168982580.8275.1169588211@webmail.messagingengine.com>
References: <1168982580.8275.1169588211@webmail.messagingengine.com>

"Jeremy Haile" <jhaile@fastmail.fm> writes:
> Running PostgreSQL 8.2.1 on Win32.   The query planner is choosing a seq
> scan over index scan even though index scan is faster (as shown by
> disabling seqscan).  Table is recently analyzed and row count estimates
> seem to be in the ballpark.

Try reducing random_page_cost a bit.  Keep in mind that you are probably
measuring a fully-cached situation here, if you repeated the test case.
If your database fits into memory reasonably well then that's fine and
you want to optimize for that case ... but otherwise you may find
yourself pessimizing the actual behavior.

			regards, tom lane



view thread (21+ messages)  latest in thread

Message-ID: <26412.1168983547@sss.pgh.pa.us>
Permalink:  ../26412.1168983547@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26412.1168983547@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, jhaile@fastmail.fm
  Subject: Re: PG8.2.1 choosing slow seqscan over idx scan
  In-Reply-To: <26412.1168983547@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