Lets suppose we create a table called "SampleTable
" and made "ID
" column a primary key. SQL Server by default creates a clustered index on the table. This physically sorts the data on the disk. Now suppose we create a view called "SampleView
" with schema binding as select * from "SampleTable"
and create a clustered index on the "SampleView
". Now SQL Server will create a clustered index on the view and physically sort the data on the disk according to the clustered index.
If the data is already sorted on disk in SampleTable
, how can it be sorted again in SampleView
?