From: Tom Lane <tgl@sss.pgh.pa.us>
To: Carlos Lopez <chlopezl@yahoo.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-performance@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: Re: [PERFORM] poor performance in migrated database
Date: Mon, 08 Nov 2004 18:57:58 -0500
Message-ID: <12047.1099958278@sss.pgh.pa.us> (raw)
In-Reply-To: <20041108212841.75273.qmail@web52705.mail.yahoo.com>
References: <20041108212841.75273.qmail@web52705.mail.yahoo.com>
Carlos Lopez <chlopezl@yahoo.com> writes:
> This is one of the queries that work,and is the first
> in a 4 level nested query....
Do you really need UNION (as opposed to UNION ALL) in this query?
The EXPLAIN shows that almost half the runtime is going into the
sort/uniq to eliminate duplicates ... and according to the row
counts, there are no duplicates, so it's wasted effort.
I looked at your schema and saw an awful lot of SELECT DISTINCTs
that looked like they might not be necessary, too. But I'm not
willing to crawl through 144 views with no information about
which ones are causing you problems. What's a typical query
that you are unsatisfied with the performance of?
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, chlopezl@yahoo.com, simon@2ndquadrant.com, pgsql-admin@postgresql.org
Subject: Re: [PERFORM] poor performance in migrated database
In-Reply-To: <12047.1099958278@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