I've been googling back and forth for this, and could not get a grasp of how are the table data blocks structured on the disk.
Many resources state that doing a full table scan reads the blocks sequentially (which means that the DB is able to read multiple block at a time), but i couldn't find any resource actually describing how are blocks kept on disk in the case of a heap VS the case of a clustered index.
Heaps do not dictate order, which reasons with the fact that the DB does not care about the order of blocks that it reads from the disk but:
- I still didn't find any evidence which guarantees that heap data is stored sequentially on disk
- With a clustered index, the order of the results does matter. In that case, i can't understand how can the DB keep blocks sequentially while still keeping the order. Does sequential reads still hold with a clustered index?
Any resource which describes how blocks are laid out on disk in each case, would help