This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
statistics_indexes [2017/10/10 14:01] markmeteenk |
statistics_indexes [2017/10/10 14:17] (current) markmeteenk |
||
---|---|---|---|
Line 59: | Line 59: | ||
**Clustered index** | **Clustered index** | ||
- | A clustered index means that data in a table is stored sorted by the fields in the index, so the query optimizer can find data as fast as possible. There can only be one clustered index. | + | A clustered index means that data in a table is stored sorted by the fields in the index, so the query optimizer can find data as fast as possible. There can only be one clustered index. If a primary key exists in a table, that will be the clustered index. |
**Non-clustered index** | **Non-clustered index** | ||
Line 66: | Line 66: | ||
Keeping the indices up-to-date can be done by means of REORGANIZE or REBUILD. The REORGANIZE option tries to find how much the data changed in a table (relatively) and will update the index if needed. The REBUILD option is the same as dropping the index and creating it again. | Keeping the indices up-to-date can be done by means of REORGANIZE or REBUILD. The REORGANIZE option tries to find how much the data changed in a table (relatively) and will update the index if needed. The REBUILD option is the same as dropping the index and creating it again. | ||
+ | |||
+ | |||
===== Statistics vs indexes ===== | ===== Statistics vs indexes ===== |