Re: improving performance of UNION and ORDER BY

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Chris Gamache <cgg007(at)yahoo(dot)com>
Cc: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: improving performance of UNION and ORDER BY
Date: 2002-03-04 16:25:18
Message-ID: 20020304082332.E76685-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mon, 4 Mar 2002, Chris Gamache wrote:

> That cut the query down to 6 seconds. About 5 seconds longer than I would like
> it. I'll take any performance increase, tho. I tried SET enable_seqscan=off;
> And it takes 8 seconds. Strange indeed.
>
> The reason I don't put the two tables together is that the tables don't have
> the exact same structure... I suppose I could merge the two, but it would be
> counterintuitive to logically apply some fields in table a to data collected
> for table b. Plus, I do so many more operations on the single tables than the
> joined tables that it wouldn't make good use of programming time to rewrite all
> the single table ops.
>
> I know... excuses, excuses! Thanks for the input. Any more ideas?

Are there going to possibly be equal rows in the two parts that you need
to merge into one row? If not, try union all which should get rid of a
sort and unique I think.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-03-04 16:26:17 Re: Which trigger execute which function?
Previous Message tony 2002-03-04 16:22:41 mail