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 Administration
 sql query performance - join

Author  Topic 

coresqldba
Starting Member

3 Posts

Posted - 2012-07-07 : 03:56:23
pls suggest index creation-
i have 2 tables, 1 is having 100000 rows, 2 is having 50 rows,
will the order of table in a select query make any difference in performance ? why?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-07-07 : 08:45:28
Order in which you join the tables does not make any difference.

In order to figure out which indexes, if any you should create, you have to look at the query. As a rule of thumb, if you have indexes on the columns that you join and the columns in the where clause that would help. But that is a simplified world view - it depends on other things as well. Post your query, and there are experts on this forum who would be able to offer advice. They may ask for more information such as table DDL's etc., but start by posting the query.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-07 : 16:35:58
you can use below query as a guidance for determining what indexes to be created

http://www.mssqltips.com/sqlservertip/1634/using-sql-server-dmvs-to-identify-missing-indexes/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -