Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 48E73476950 for ; Wed, 26 Jun 2002 23:38:13 -0400 (EDT) Mailbox-Line: From tgl@sss.pgh.pa.us Wed Jun 26 23:38:13 2002 Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 2FC57476287 for ; Wed, 26 Jun 2002 23:37:28 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5R3bQv22265; Wed, 26 Jun 2002 23:37:27 -0400 (EDT) To: nickf@ontko.com Cc: "pgsql-admin" Subject: Re: Are statistics gathered on function indexes? In-reply-to: References: Comments: In-reply-to "Nick Fankhauser" message dated "Wed, 26 Jun 2002 14:36:01 -0500" Date: Wed, 26 Jun 2002 23:37:26 -0400 Message-ID: <22262.1025149046@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-5.4 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT,SUBJ_ENDS_IN_Q_MARK version=2.30 X-Spam-Level: X-Archive-Number: 200206/215 X-Sequence-Number: 4649 "Nick Fankhauser" 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