Quite a lot of time I have come across people saying "Clustered Index Physically sorts the data inside the table based on the Clustered Index Keys". It's not completely true! The short answer to them is there is something called "Row offset Array" in a PAGE which manages the order of rows in a PAGE. For a long answer with a sample script read on... There can lot of rows inserted one after the other and as we know each row can vary in size. That being the case how does SQL Server know where a row begins and where does it end? That's where ROW OFFSET table/array comes into picture. A ROW OFFSET array starts at the end of the PAGE, and it contains one entry for each row on the PAGE. Each entry records how far the first Byte of the row is from the start of the PAGE. The entries in the row offset table are in reverse sequence from the sequence of the rows on the PAGE. CREATE TABLE ci_order_example ( Sno INT NOT NULL PRIMARY KEY, Fname VARCHAR(20...
I write about things which I am passionate about.