SQL Index and SQL Plan
Index : Indexes are used to improve the performance of searching. An index makes a search faster by using a Balanced Tree (B-Tree) Structure. In B-Tree Structure data divided into root node, non- leaf nodes and leaf nodes. An index is a pointer to data in a table. Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Example : Index has two types which helps to search fast : 1. Clustered Index : A Clustered Index stores the actual data at the leaf node. In SQL server clustered index is created automatically, when a primary key is created. Only one clustered index is created per table. Creating Clustered Index in SQL server : 1. Go to Design of a table, then right click on column and select Indexes/ Keys : 2. After that in Table Designer set 'Create As Clustered' as Yes, See Clustered index is created : 2. Non-Clustered Index: The leaf nodes of non-clustered index doesn't know where the data is? Leaf node of non-clu...