pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Steve McLellan <smclellan@mintel.com>
To: pgsql-performance@postgresql.org
Subject: Re: Query performance over a large proportion of data
Date: Tue, 10 Mar 2009 17:06:38 -0500
Message-ID: <49B69E1E.EE98.0025.0@wicourts.gov> (raw)
In-Reply-To: <1ca6422a7addad0207f758f54300dd0b.squirrel@semichrome.net>
References: <1ca6422a7addad0207f758f54300dd0b.squirrel@semichrome.net>

>>> "Steve McLellan" <smclellan@mintel.com> wrote: 
> The server itself is a dual-core 3.7GHz Xeon Dell (each core
> reporting 2 logical CPUs) running an amd64 build of FreeBSD 6.2, and
> postgres 8.3.5 built from source. It's got 400GB storage in RAID-5
> (on 5 disks). It has 8GB of physical RAM. I'm able to use about 6GB
> of that for my own purposes; the server doesn't do much else but
> replicates a very low-usage mysql database.
 
> shared_buffers=1200MB
 
You might want to play with this -- that's not a bad starting point,
but your best performance with your load could be on either side of
that value.
 
> work_mem = 100MB
 
Probably kinda high, especially if you expect a lot of connections. 
This much memory can be concurrently used, possibly more than once, by
each active connection.
 
> fsync = off
 
Don't use this setting unless you can afford to lose your entire
database cluster.  We use it for initial (repeatable) loads, but not
much else.
 
> enable_seqscan = off
 
Not a good idea; some queries will optimize better with seqscans.
You can probably get the behavior you want using other adjustments.
 
> effective_cache_size = 2000MB
 
From what you said above, I'd bump this up to 5GB or more.
 
You probably need to reduce random_page_cost.  If your caching is
complete enough, you might want to set it equal to seq_page_cost
(never set it lower that seq_page_cost!) and possibly reduce both of
these to 0.1.
 
Some people have had good luck with boosting cpu_tuple_cost and
cpu_index_tuple_cost.  (I've seen 0.5 for both recommended.)  I've
never had to do that, but if the earlier suggestions don't get good
plans, you might try that.
 
I hope that helps.
 
-Kevin



view thread (15+ messages)  latest in thread

Message-ID: <49B69E1E.EE98.0025.0@wicourts.gov>
Permalink:  ../49B69E1E.EE98.0025.0@wicourts.gov/
Also on:    postgresql.org/message-id/49B69E1E.EE98.0025.0@wicourts.gov

 · 

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: Kevin.Grittner@wicourts.gov, smclellan@mintel.com
  Subject: Re: Query performance over a large proportion of data
  In-Reply-To: <49B69E1E.EE98.0025.0@wicourts.gov>

* 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