Re: Slow Query

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-performance(at)postgresql(dot)org>, "Shawn" <postgres(at)xmtservices(dot)net>
Subject: Re: Slow Query
Date: 2007-09-03 18:32:13
Message-ID: 46DC0CDD.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>>> On Mon, Sep 3, 2007 at 11:57 AM, in message
<20070903095749(dot)5045211b(at)boffin(dot)xmtservices(dot)net>, Shawn
<postgres(at)xmtservices(dot)net> wrote:
> Also it runs a lot faster by itself

Given the context of the run, there is a possibility that a checkpoint tends
to fall at this point in the script because you're filling your WAL files.
There is a known issue (which people have been working on fixing in 8.3)
which causes the checkpoint to push a lot of pages to the disk and then wait
on physical writes. If the VACUUM ANALYZE doesn't turn up anything useful,
an interesting experiment would be to run your script with these
modifications to your postgresql.conf file:

bgwriter_lru_percent = 20.0 # 0-100% of LRU buffers scanned/round
bgwriter_lru_maxpages = 200 # 0-1000 buffers max written/round
bgwriter_all_percent = 10.0 # 0-100% of all buffers scanned/round
bgwriter_all_maxpages = 600 # 0-1000 buffers max written/round

Don't leave these in effect permanently without close attention to the
overall impact. These settings have worked well for us, but are likely
not to work well for everyone.

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Shawn 2007-09-03 23:53:34 Re: Slow Query
Previous Message Kevin Grittner 2007-09-03 18:07:41 Re: Slow Query