Re: Query not using index pgsql 8.2.3

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Henrik Zagerholm <henke(at)mac(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query not using index pgsql 8.2.3
Date: 2007-03-23 13:43:21
Message-ID: 20070323134321.GA86039@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark 2007-03-23 13:50:49 question: knopixx and postgresql on flash drive
Previous Message Henrik Zagerholm 2007-03-23 13:13:57 Re: Query not using index pgsql 8.2.3