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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 which one is faster

Author  Topic 

chbala85
Starting Member

49 Posts

Posted - 2013-06-27 : 01:08:18
Hi,

i have a requirement to get data from more than one table.
but i am using subqueries to get the data,someone saying write a query using setoperater.

which is one is faster subquery or setoperator query and also provide some performance tips.

Thank,
krish.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-27 : 01:17:45
depending on scenario and presence of indexes, joins may also prove to perform better than subqueries.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-06-27 : 12:35:03
write the query and test run it with a suitable workload. You could analyse the execution plan.
Try and apply set theory as efectively as possible, for example avoid looping such as cursors. Some other hints and tips to optimize http://www.sqlserver-dba.com/2011/11/stored-procedure-checklist.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -