Re: Tuning/performance question. - Mailing list pgsql-general

From Tom Lane
Subject Re: Tuning/performance question.
Date
Msg-id 9442.1064765602@sss.pgh.pa.us
Whole thread Raw
In response to Re: Tuning/performance question.  (Holger Marzen <holger@marzen.de>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Rewriting pg_upgrade (was Re: State of Beta 2)
Next
From: Bruce Momjian
Date:
Subject: Re: Rewriting pg_upgrade (was Re: State of Beta 2)