Results 1 to 3 of 3

Thread: Oracle union

  1. #1
    Join Date
    Jul 2003
    Posts
    46

    Unanswered: Oracle union

    Hi,
    I have two tables - t1 and t2
    Execution time for select c1,..,ck from t1 is about 50 ms
    Execution time for select c1,..,ck from t2 is about 50 ms
    Execution time for
    select c1,...,ck from t2
    union
    select c1,...,ck from t1 is about 4s
    Why does union last so long ??
    Thank you very much for any ideas
    Szalas

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Oracle union

    UNION has to sort the records and remove any duplicates, which takes time. If this is not required, use UNION ALL.

  3. #3
    Join Date
    Jul 2003
    Posts
    46

    Re: Oracle union

    Thank you very much it works
    Szalas

Posting Permissions

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