Re: improving performance of UNION and ORDER BY - Mailing list pgsql-general

From Stephan Szabo
Subject Re: improving performance of UNION and ORDER BY
Date
Msg-id 20020304082332.E76685-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: improving performance of UNION and ORDER BY  (Chris Gamache <cgg007@yahoo.com>)
List 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.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: backend closed
Next
From: Doug McNaught
Date:
Subject: Re: postgre performance question