What does it mean that a "clustered index does not store pointers to the data"? I am a beginner in SQL and Database Administration and I am trying to undestand the difference between clustered and non-clustered indexes. More or less I understood what the different tasks are but I have some issues when it comes to the question of &quot;pointers&quot;. I don´t come from CS so I have some issue to imagine what happens at the &quot;leaf level&quot; with the pointers and in which way they connect the index to the data. So, what does it mean that a clustered index does not store pointers to the data, while, the non-clustered one, does it?
Sorry in advance if these questions sound stupid but at this point I am pretty confused!
No, that's not a bad question.
In MS SQL Server (and others that work similarly), a clustered index doesn't store pointers to the data because it doesn't need to, a clustered index actually contains the table data itself.
A clustered index is the table, just ordered in a particular way.
If you create and populate a brand new table with no clustered index (called a &quot;heap&quot;), then add a non-clustered index, you're creating a new (ordered) object that still has to point to the rows in the actual table.
But if you take that heap and add a clustered index, you are literally re-ordering the table itself.