pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-performance@postgresql.org
Cc: Brendan Duddridge <brendan@clickspace.com>
Subject: Re: Query using SeqScan instead of IndexScan
Date: Wed, 29 Mar 2006 21:18:49 -0800
Message-ID: <200603292118.50033.josh@agliodbs.com> (raw)
In-Reply-To: <2F1712F1-E5E2-455E-A291-06F300A66549@clickspace.com>
References: <2F1712F1-E5E2-455E-A291-06F300A66549@clickspace.com>

Brenden,

> Any ideas what I can do to improve this without turning sequential  
> scanning off?

Hmmm, looks like your row estimates are good.  Which means it's probably your 
postgresql.conf parameters which are off.  Try the following, in the order 
below:

1) Raise effective_cache_size to 2/3 of your RAM (remember that ecs is in 8k 
pages).  Test again.

2) Multiply all of the cpu_* costs by 0.3.  Test again.

3) Lower random_page_cost by steps to 3.5, then 3.0, then 2.5, then 2.0, 
testing each time.

These are all runtime-settable parameters, so you can test them in one query 
window, then set them in the main postgresql.conf if they work.

-- 
Josh Berkus
Sun Microsystems
San Francisco



view thread (18+ messages)  latest in thread

Message-ID: <200603292118.50033.josh@agliodbs.com>
Permalink:  ../200603292118.50033.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200603292118.50033.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com, brendan@clickspace.com
  Subject: Re: Query using SeqScan instead of IndexScan
  In-Reply-To: <200603292118.50033.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox