From: Tom Lane <tgl@sss.pgh.pa.us>
To: nickf@ontko.com
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Are statistics gathered on function indexes?
Date: Wed, 26 Jun 2002 23:37:26 -0400
Message-ID: <22262.1025149046@sss.pgh.pa.us> (raw)
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGMEHPFDAA.nickf@ontko.com>
References: <NEBBLAAHGLEEPCGOBHDGMEHPFDAA.nickf@ontko.com>
"Nick Fankhauser" <nickf@ontko.com> writes:
> [see subject]
Nope, they ain't. I agree they should be.
> Can someone tell me how the cost is estimated for retrieving a column based
> on a function that is indexed?
It falls back to a default selectivity estimate, which is something
like 1% or 0.5% (depending on which version you are running).
> Also, even with 2168 rows to gather, my experience based on cases where
> several thousand rows really are returned indicates that the index would
> still be a good choice. Is there a way to make the planner favor index scans
> a bit more? (Other than the drastic set enable_seqscan to off.)
I'd suggest reducing random_page_cost; we've seen a number of anecdotal
reports that the default of 4.0 is too high, though nothing systematic
enough to refute the experiments I did to get that number awhile back.
(IMHO anyway. Others may differ.)
regards, tom lane
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, nickf@ontko.com
Subject: Re: Are statistics gathered on function indexes?
In-Reply-To: <22262.1025149046@sss.pgh.pa.us>
References: <NEBBLAAHGLEEPCGOBHDGMEHPFDAA.nickf@ontko.com> <22262.1025149046@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