pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!!
Date: Sun, 28 Jul 2002 13:22:02 -0400
Message-ID: <11600.1027876922@sss.pgh.pa.us> (raw)
In-Reply-To: <014c01c2361e$62a53c30$1aadd6c2@GMENDOLA2>
References: <014c01c2361e$62a53c30$1aadd6c2@GMENDOLA2>

"Gaetano Mendola" <mendola@bigfoot.com> writes:
> I'm going to set the parameter cpu_tuple_cost = 0.1 to
> my server, I'm wrong ?

This seems very excessively high.  1.0 corresponds to one disk read,
which is in the several-milliseconds range on most modern systems.
You're essentially claiming that your CPU requires about a millisecond
for per-tuple overhead, which is way off base (unless you're using
an 8086 or some such...)  My feeling is that the default value of 0.01
is already on the high side, and getting more so as CPUs get faster
compared to disks.

It's always possible to force the optimizer to choose "the right answer"
in one particular case by pushing out some parameter setting far beyond
the reasonable range, but I think you'll find that this answer breaks
more stuff than it fixes.

A saner way of tweaking the index-vs-seqscan costs is to reduce
random_page_cost a little --- the default is 4.0 which may be on the
high side.  (But don't push it below 1.0.)

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <11600.1027876922@sss.pgh.pa.us>
Permalink:  ../11600.1027876922@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11600.1027876922@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 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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mendola@bigfoot.com
  Subject: Re: cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!!
  In-Reply-To: <11600.1027876922@sss.pgh.pa.us>
  References: <014c01c2361e$62a53c30$1aadd6c2@GMENDOLA2> <11600.1027876922@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