From: Josh Berkus <josh@agliodbs.com>
To: Max Baker <max@warped.org>
To: Robert Treat <xzilla@users.sourceforge.net>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Joe Conway <mail@joeconway.com>
Cc: Manfred Koizar <mkoi-pg@aon.at>
Cc: PostgreSQL Performance Mailing List <pgsql-performance@postgresql.org>
Subject: Re: speeding up COUNT and DISTINCT queries
Date: Fri, 14 Mar 2003 09:10:06 -0800
Message-ID: <200303140910.06416.josh@agliodbs.com> (raw)
In-Reply-To: <20030313202254.GD30411@warped.org>
References: <20030312223811.GM30411@warped.org>
<1047585930.23128.913.camel@camel>
<20030313202254.GD30411@warped.org>
Max,
> I'm not starting with fresh data every time, I'm usually checking for
> an existing record, then setting a timestamp and a boolean flag.
>
> I've run some profiling and it's about 8000-10,000 UPDATEs every 4
> hours. These are accompanied by about 800-1000 INSERTs.
If these are wide records (i.e. large text fields or lots of columns ) you may
want to consider raising your max_fsm_relation in postgresql.conf slightly,
to about 15,000.
You can get a better idea of a good FSM setting by running VACUUM FULL VERBOSE
after your next batch (this will lock the database temporarily) and seeing
how many data pages are "reclaimed", in total, by the vacuum. Then set your
FSM to at least that level.
And has anyone mentioned REINDEX on this thread?
--
Josh Berkus
Aglio Database Solutions
San Francisco
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: josh@agliodbs.com, max@warped.org, xzilla@users.sourceforge.net, gsstark@mit.edu, mail@joeconway.com, mkoi-pg@aon.at
Subject: Re: speeding up COUNT and DISTINCT queries
In-Reply-To: <200303140910.06416.josh@agliodbs.com>
References: <20030312223811.GM30411@warped.org> <1047585930.23128.913.camel@camel> <20030313202254.GD30411@warped.org> <200303140910.06416.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