By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

UNION query is too slow!

P: 7
I have two seperate queries which are both returning the same fields with the same domains and all the union integrity you need to union them together.

One has about 9000 records and the other has about 1700 records.

When i run them individually, they each run and display instantly.

When i union them together like this:

(SELECT * FROM qryOEOrderHistory)
UNION
(SELECT * FROM qryOEOrderHistoryCredit)

-it takes 30 - 40 seconds!!!

what are my possibilities? things i should check for???
Jul 16 '07 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,366
A Union leaves out duplicates.
If you don't care about duplicates or there shouldn't be any duplicates then Union All should run faster.
Jul 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.