pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Rob Messer <rrmesser@yahoo.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Optimizer not using index when it should
Date: 29 Apr 2003 09:04:09 -0400
Message-ID: <1051621449.76105.9.camel@jester> (raw)
In-Reply-To: <20030429090301.13152.qmail@web41213.mail.yahoo.com>
References: <20030429090301.13152.qmail@web41213.mail.yahoo.com>

> What can I do to fix this -- is there something I am missing about
> setting statistics or some configuration variable I can change?  Any
> insights would be greatly appreciated.  Thank you,

If you look at the estimates for cost, the index scan is more expensive
by ~1/8th. But as you've shown, it's not.

You might try adjusting the random_page_cost down to something more
appropriate for your hardware and situation.

Do testing... this may cause other queries to use an index scan when
they should have been doing a sequential scan.  Mistakenly using an
index can be a much more costly error (hence the high default
random_page_cost).

-- 
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (3+ messages)  latest in thread

Message-ID: <1051621449.76105.9.camel@jester>
Permalink:  ../1051621449.76105.9.camel@jester/
Also on:    postgresql.org/message-id/1051621449.76105.9.camel@jester

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: rbt@rbt.ca, rrmesser@yahoo.com
  Subject: Re: Optimizer not using index when it should
  In-Reply-To: <1051621449.76105.9.camel@jester>
  References: <20030429090301.13152.qmail@web41213.mail.yahoo.com> <1051621449.76105.9.camel@jester>

* 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