|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, June 21, 2010 5:29 AM
Points: 920,
Visits: 470
|
|
Dear All,
Can any one tell me the relation between the index fields and the query criteria sequence.
I have created the index for all the fields in the database individually.
If I am querying the database with by specifying two fields in the criteria field.
What will happen, will the performance is increased or not?
Kindly give me your suggestion.
Thanks a lot in advance. :)
Nothing is impossible with Hard Work:)
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:02 AM
Points: 3,131,
Visits: 1,056
|
|
If your join condition matches with the index fields the query will also performs faster.
It is not the index that imporve the performance. You should look out at defragmentation aslo. If the fragmentation is at the highest level the query also improves.
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 9:03 PM
Points: 31,406,
Visits: 13,723
|
|
You should not index ALL the fields. That will slow down your updates/inserts/deletes.
You want to include indexes on those fields which are mostly used for queries. If you have two items in the WHERE clause, it depends. You can include both fields in the index, you can have separate indexes that might be used.
Best bet is to get the execution plans for those queries often run and look to see if you are getting index seeks.
Follow me on Twitter: @way0utwest
 Forum Etiquette: How to post data/code on a forum to get the best help
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: 2 days ago @ 12:22 PM
Points: 10,571,
Visits: 11,871
|
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, June 21, 2010 5:29 AM
Points: 920,
Visits: 470
|
|
Dear All,
Thanks for you replies.
I have the table which contains some properties of the document in my knowledge repository.
The user can search by specifying any values to the properties.
Based on the values in the properties the where criteria is framed and then I am sending this to the stored procedure.
In the stored procedure I am framing the dynamic query with the where clause with the input where clause.
The table has minimum more than 200000 documents.
So I don't know how to make the index.
I had a discussion and some were saying that I can have index for all the fields.
Can any one tell me how to resolve this?
Thanks a lot.
Nothing is impossible with Hard Work:)
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:15 PM
Points: 37,651,
Visits: 29,903
|
|
Can you post the proc, the table and the index defs? Are there certain columns that will be more frequently searched than others?
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 11:13 AM
Points: 1,431,
Visits: 1,539
|
|
Jaya Chitra (9/23/2008) Dear All,
Thanks for you replies.
I have the table which contains some properties of the document in my knowledge repository.
The user can search by specifying any values to the properties.
Based on the values in the properties the where criteria is framed and then I am sending this to the stored procedure.
In the stored procedure I am framing the dynamic query with the where clause with the input where clause.
The table has minimum more than 200000 documents.
So I don't know how to make the index.
I had a discussion and some were saying that I can have index for all the fields.
Can any one tell me how to resolve this?
Thanks a lot.
Study the clustered,nonclustered and covering indexes in BOL.... Making a clustered index on the columns in where clause will improve performance
Regards, Sqlfrenzy
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 11:13 AM
Points: 1,431,
Visits: 1,539
|
|
Jaya Chitra (9/23/2008) Dear All,
Thanks for you replies.
I have the table which contains some properties of the document in my knowledge repository.
The user can search by specifying any values to the properties.
Based on the values in the properties the where criteria is framed and then I am sending this to the stored procedure.
In the stored procedure I am framing the dynamic query with the where clause with the input where clause.
The table has minimum more than 200000 documents.
So I don't know how to make the index.
I had a discussion and some were saying that I can have index for all the fields.
Can any one tell me how to resolve this?
Thanks a lot.
Study the clustered,nonclustered and covering indexes in BOL.... Making a clustered index on the columns in where clause will improve performance
Regards, Sqlfrenzy
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 10:54 AM
Points: 120,
Visits: 278
|
|
I would stick with the Design Guidelines for using clustered/non clustered indexes that appears on MSDN. It should give a pretty good idea as to where and what kind of index you might want to use.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 26, 2013 10:54 AM
Points: 120,
Visits: 278
|
|
I was just curious about the columns that you might have in there! Could you provide us some detail about that (It would be great for me since I am new to this field and exploring things )
|
|
|
|