pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: S Grannis <sjg@email.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Performance Issues with count()
Date: Thu, 25 Apr 2002 12:35:00 -0700 (PDT)
Message-ID: <20020425123052.N71187-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <20020425185441.10228.qmail@email.com>


On Thu, 25 Apr 2002, S Grannis wrote:

> Others have suggested the "fix" is in the future.
>
> Stephan Szabo wrote:
> "I didn't see anything about your settings in postgresql.conf,
> but increasing the sort_mem parameter may help that really
> expensive sort step. I think the desired fix for this would
> probably be the TODO entry on hash based aggregates but that's
> still in the future..."
>
> The "non-default" postgresql.conf settings are as follows:
>
> shared_buffers = 240000 # uses ~2GB of shared mem
> sort_mem = 512

It might be interesting to try with sort_mem set up an order
of magnitude to see if that helps at all.  I doubt it'll be
enough, but it's probably worth trying.

> I think our work-around for now will be to SELECT the column we wish
> to analyze into a flat file and then run a Perl script to do the
> actual counting.

Another option would be a C function that does runs a query via
SPI and does the hashing count and sticks it in a temporary table
but that may be a bit excessive.





view thread (4+ messages)

Message-ID: <20020425123052.N71187-100000@megazone23.bigpanda.com>
Permalink:  ../20020425123052.N71187-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020425123052.N71187-100000@megazone23.bigpanda.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 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-admin@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, sjg@email.com, pgsql-general@postgresql.org
  Subject: Re: Performance Issues with count()
  In-Reply-To: <20020425123052.N71187-100000@megazone23.bigpanda.com>
  References: <20020425185441.10228.qmail@email.com> <20020425123052.N71187-100000@megazone23.bigpanda.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