Re: indexes are farked

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
Cc: Dr NoName <spamacct11(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: indexes are farked
Date: 2005-08-02 19:08:58
Message-ID: 20050802190858.GA74118@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 02, 2005 at 01:41:48PM -0500, Scott Marlowe wrote:
> Also, you might want to look at tuning your database. I've found that
> on machines that can cache most of their data sets, adjusting things
> like effective_cache_size and random_page_cost makes a big difference.

Also, as Ragnar Hafstað suggested, consider increasing the statistics
target on the column in question. The row estimate (27833) was
over five times higher than the actual number of rows (5261),
resulting in an overinflated cost estimate for an index scan.
Increasing the statistics should help the planner make a more
accurate estimate. Here are some useful links:

http://www.postgresql.org/docs/7.3/static/performance-tips.html#USING-EXPLAIN
http://www.postgresql.org/docs/7.3/static/planner-stats.html
http://developer.postgresql.org/docs/postgres/planner-stats-details.html

The last link will be in the documentation for 8.1 when it's released,
but I think it largely applies to earlier versions as well.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-08-02 19:21:01 Re: Slow Inserts on 1 table?
Previous Message Tom Lane 2005-08-02 18:56:04 Re: Problem with dropping a tablespace