Paul Hill <> wrote:
> On 2/1/07, Malcolm Greene <[EMAIL PROTECTED]> wrote:
>> Are there any ways to optimize UNION performance - in general or with
>> an Oracle 8.17 backend?
>>
>> I have 5 data sets that I need to merge via a UNION and the time to
>> its to build each set individually is 9 secs but the time it takes to
>> build the same set of data and union together into a single set is
>> 33 seconds.
>>
>> The total set size is 1M of records with the largest set being
>> unioned
>> being about 750K.
>>
>> I've tried rearranging the position of the big data set in the union
>> process, but this does not affect performance.
>>
>> Any tips or am I just seeing what's pretty much standard overhead for
>> performing unions.
>
> IIRC a UNION will only include unique records from each query.
> Probably that's where the slowdown is happening. Do you need this?
> If not UNION ALL should be faster.
>
> Another approach would be to use a temporary table.
A union is used for two different reasons. To gain data from multiple input
tables as well as in place of the "OR" in a where clause
Stephen Russell
DBA / .Net Developer
Memphis TN 38115
901.246-0159
"A good way to judge people is by observing how they treat those who
can do them absolutely no good." ---Unknown
http://spaces.msn.com/members/srussell/
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.19/663 - Release Date: 2/1/2007
2:28 PM
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.