Re: Index not used - now me - Mailing list pgsql-sql

From Tom Lane
Subject Re: Index not used - now me
Date
Msg-id 20551.1076344722@sss.pgh.pa.us
Whole thread Raw
In response to Re: Index not used - now me  (Greg Stark <gsstark@mit.edu>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Christopher Browne
Date:
Subject: Re: timestamptz - problems
Next
From: Mark Gibson
Date:
Subject: Re: Implementation of a bag pattern using rules