The index provides a fast way to look up data based on the values within those columns.For example, if you create an index on the primary key and then search for a row of data based on one of the primary key values,SQL Server first finds that value in the index, and then uses the index to quickly locate the entire row of data. Without the index, a table scan would have to be performed in order to locate the row, which can have a significant effect on performance.
CREATE INDEX index1 ON tbl1 (Fname); /*Simple Index*/
CREATE UNIQUE INDEX Uindex1 ON tbl1 (Fname);/*UNIQUE Index*/
CREATE INDEX index2 ON tbl1 (Fname DESC);
CREATE INDEX index3 ON tbl1 (Fname,city);
/*DROP INDEX table_name.index_name*/
DROP INDEX tbl.index1;
No comments:
Post a Comment