Re: Optimizer not using index when it should - Mailing list pgsql-performance

From Rod Taylor
Subject Re: Optimizer not using index when it should
Date
Msg-id 1051621449.76105.9.camel@jester
Whole thread Raw
In response to Optimizer not using index when it should  (Rob Messer <rrmesser@yahoo.com>)
Responses Re: Optimizer not using index when it should  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
> 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

Attachment

pgsql-performance by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: profiling plpgsql functions..
Next
From: "SZŰCS Gábor"
Date:
Subject: Query Plan far worse in 7.3.2 than 7.2.1