pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@mit.edu>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: paul@tmsl.demon.co.uk
Cc: pgsql-sql@postgresql.org
Subject: Re: Index not used - now me
Date: Mon, 09 Feb 2004 11:38:42 -0500
Message-ID: <20551.1076344722@sss.pgh.pa.us> (raw)
In-Reply-To: <878yjcntra.fsf@stark.xeocode.com>
References: <200402091502.QAA19246@rodos>
	<878yjcntra.fsf@stark.xeocode.com>

Greg Stark <gsstark@mit.edu> writes:
> You could also try lowering random_page_cost. Some people find as low as 1.2
> or so to be useful, but that would almost certainly be lying to postgres about
> the costs of random access and would cause it to use index scans aggressively
> even when they're not faster.

If the database is small enough to mostly fit in kernel disk cache, then
a very low random_page_cost is telling the truth, not lying.  One might
also think about raising the various CPU_xxx cost parameters, since CPU
effort becomes proportionally much more significant when "I/O" only
requires a trip to kernel buffers.

However, Christoph's example looks to me like a classic case of testing
a toy table and assuming the results will extrapolate to production-size
cases.  This table is small enough that it hardly matters which method
the planner chooses.  I'd counsel being very wary about adjusting the
cost settings based on only this example.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <20551.1076344722@sss.pgh.pa.us>
Permalink:  ../20551.1076344722@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20551.1076344722@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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gsstark@mit.edu, ch@rodos.fzk.de, paul@tmsl.demon.co.uk
  Subject: Re: Index not used - now me
  In-Reply-To: <20551.1076344722@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