From: Tom Lane <tgl@sss.pgh.pa.us>
To: holger@marzen.de
Cc: David Griffiths <dgriffiths@boats.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Tuning/performance question.
Date: Sun, 28 Sep 2003 12:13:22 -0400
Message-ID: <9442.1064765602@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.58.0309281308470.27404@bluebell.marzen.de>
References: <DBEIKNMKGOBGNDHAAKGNIENDFBAC.dave@hawk-systems.com>
<01d201c38573$84606930$6501a8c0@griffiths2>
<Pine.LNX.4.58.0309281308470.27404@bluebell.marzen.de>
Holger Marzen <holger@marzen.de> writes:
> But many users compain about PostgreSQL's poor count(*) performance,
I don't think that's relevant here. Some other DB's have shortcuts for
determining the total number of rows in a single table, that is they can
do "SELECT COUNT(*) FROM a_table" quickly, but David's query is messy
enough that I can't believe anyone can actually do it without forming
the join result.
What I'd ask for is EXPLAIN ANALYZE output. Usually, if a complex query
is slower than it should be, it's because the planner is picking a bad
plan. So you need to look at how its estimates diverge from reality.
But plain EXPLAIN doesn't show the reality, only the estimates ...
David, could we see EXPLAIN ANALYZE for the query, and also the table
schemas (psql \d displays would do)? Also, please take it to
pgsql-performance, it's not really on-topic for pgsql-general.
regards, tom lane
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: tgl@sss.pgh.pa.us, holger@marzen.de, dgriffiths@boats.com, pgsql-general@postgresql.org
Subject: Re: Tuning/performance question.
In-Reply-To: <9442.1064765602@sss.pgh.pa.us>
References: <DBEIKNMKGOBGNDHAAKGNIENDFBAC.dave@hawk-systems.com> <01d201c38573$84606930$6501a8c0@griffiths2> <Pine.LNX.4.58.0309281308470.27404@bluebell.marzen.de> <9442.1064765602@sss.pgh.pa.us>
* 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