Re: Are statistics gathered on function indexes?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nickf(at)ontko(dot)com
Cc: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Are statistics gathered on function indexes?
Date: 2002-06-27 03:37:26
Message-ID: 22262.1025149046@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Nick Fankhauser" <nickf(at)ontko(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nadim Bitar 2002-06-27 05:15:28 Authentication problems.
Previous Message Nick Fankhauser 2002-06-26 19:36:01 Are statistics gathered on function indexes?