SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 which one is faster
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chbala85
Starting Member

49 Posts

Posted - 06/27/2013 :  01:08:18  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 06/27/2013 :  01:17:45  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
2067 Posts

Posted - 06/27/2013 :  12:35:03  Show Profile  Visit jackv's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000