
November 21st, 2011, 03:53 AM
|
|
Contributing User
|
|
Join Date: Sep 2006
Location: Plovdiv. Bulgaria
Posts: 200
  
Time spent in forums: 2 Days 6 h 51 m 58 sec
Reputation Power: 11
|
|
Quote: | Originally Posted by Unspoken Thanks rapgame, but I do not think that selecting ALL columns is the problem here. (I could be always wrong). But if separated queries are executing 1 second each and UNION is simply adding one result set to the other than how can it slow down the whole operation 20 times? This is simply not logical. Unless UNION is diong something more that adding one result to the other... |
UNION removes the duplicate records from the both queries. So it's like GROUP BY all of your fields. Just for the test - how long takes if you use UNION ALL( UNION ALL doesn't remove duplicates)
Last edited by mIRCata : November 21st, 2011 at 03:55 AM.
|