Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqldev6
Starting Member
18 Posts |
Posted - 2008-03-03 : 07:01:26
|
Hi All,We have one query like......Select * from table1UNIONSelect * from table2When I am excuting this query, its excuting very slow.But when I am excuting individual queries I am getting results with in 5 seconds.What would be the causes for thsi query....Thanks in advance...... |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-03-03 : 07:04:18
|
UNION, of course. What do you think UNION does?It sorts out all duplicate records from BOTH resultsets. E 12°55'05.25"N 56°04'39.16" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-03-03 : 07:04:45
|
If you are sure no duplicates exists between the two queries, use UNION ALLinstead. E 12°55'05.25"N 56°04'39.16" |
 |
|
sqldev6
Starting Member
18 Posts |
Posted - 2008-03-03 : 07:33:33
|
I tried with UNION ALL, even though its running slowly.... |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-03-03 : 08:50:25
|
sqldev6 -- do you think you have given us enough information for us to help you troubleshoot?- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
|
|