SQL Server: Index #38

SQL Server: Index

  • Indexes make database access faster. Without index your queries will run but indexes can increase the performance dramatically.
  • You can define multiple indexes for a table and select the index that is required for current operations.
  • Only one clustered index is supported for a table
  • To get advantage of indexes you have to mention the index related constraints in your where clause like where last_name =’xyz’
  • If you have indexes on two or more columns, in where clause mention the first column name/constraint first [that was first in the index creation].
  • A clustered index contains table data sorted in the index where a non-clustered index contains reference to the table data or clustered index. Non-clustered indexes are both physically and logically independent of table data.

Index Best Practices

  1. Select a column/(columns) for indexes that will provide good uniqueness and selectivity otherwise indexing may degrade the performance
  2. Create indexes that result in lower number of rows to be searched
  3. Create indexes that select a range of rows
  4. Try to create clustered index with as uniqueness as possible
  5. Keep indexes as narrow as possible (not many/unnecessary columns)
  6. Don’t index very small table

In SQL server, you can create indexes through your sql statements or using the development studio interface.

From: http://sitestree.com/?p=4836
Categories:38
Tags:
Post Data:2011-01-21 05:26:33

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>