What information does a non-clustered index contain in a database?
sobes.tech AI
Answer from AI
A non-clustered index in a database contains information about the values of the indexed column and pointers (references) to the corresponding rows in the table.
Unlike a clustered index, which determines the physical order of data storage, a non-clustered index stores a separate structure (for example, a B-tree), where keys are the values of the indexed field, and leaves contain references to the physical data records.
Thus, a non-clustered index speeds up searches on the indexed column, allowing quick access to the addresses of rows with the desired values, but the data itself remains in its original order.
Example: if there is a table with columns ID and Name, and a non-clustered index is created on Name, then the index will contain sorted Name values and references to the rows with these names.