Re: Query not using index pgsql 8.2.3 - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Query not using index pgsql 8.2.3
Date
Msg-id 20070323134321.GA86039@winnie.fuhr.org
Whole thread Raw
In response to Re: Query not using index pgsql 8.2.3  (Henrik Zagerholm <henke@mac.se>)
List pgsql-general
On Fri, Mar 23, 2007 at 02:13:57PM +0100, Henrik Zagerholm wrote:
> I'm just amazed that setting the statistics threshold on one column
> mad all the difference. IS there any guidelines on what columns I
> should change the statistics on?

Start by looking for columns involved in simple comparisons with a
constant -- especially if you know that the distribution of values
is uneven -- and see how far off the row count estimate is for
various values.  You can use simple queries such as

EXPLAIN ANALYZE SELECT 1 FROM tbl_file WHERE fk_filetype_id = 83;

To learn more read "How the Planner Uses Statistics" in the
documentation:

http://www.postgresql.org/docs/8.2/interactive/planner-stats-details.html

Among the configuration settings to consider changing are shared_buffers,
effective_cache_size, work_mem, and random_page_cost.  The following
is a good starting point:

http://www.powerpostgresql.com/PerfList

If you have additional performance-related questions then consider
posting to pgsql-performance.

--
Michael Fuhr

pgsql-general by date:

Previous
From: Henrik Zagerholm
Date:
Subject: Re: Query not using index pgsql 8.2.3
Next
From: Mark
Date:
Subject: question: knopixx and postgresql on flash drive