UNION Operator Makes the query slow
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: UNION Operator Makes the query slow

  1. #1
    Join Date
    Jul 2002
    Posts
    205

    UNION Operator Makes the query slow

    Hi,

    I have two queries. Each of the queries run fast.

    But when I use UNION in between the two queries. I do not get the result set.

    It runs for ever..

    Any suggestion..?

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    UNION provides an implicit unique sort. use UNION ALL if you don't want that.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Jul 2002
    Posts
    205
    Even UNION ALL, the query result does not come out..

  4. #4
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    use the sql*pluscommand ...
    set autotrace traceonly explain
    ... to getexecution plansfor the two separatequeries and for the two queries union all'd together, and post them all here.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width