CREATE table comp_tb
(
a tinyint
)
insert into comp_tb values('4')
insert into comp_tb values('1')
insert into comp_tb values('5')
insert into comp_tb values('6')
insert into comp_tb values('10')
insert into comp_tb values('3')
insert into comp_tb values('2')
insert into comp_tb values('8')
SELECT * from comp_tb ct --as order of insert
create NONCLUSTERED INDEX NCI_a ON comp_tb(a)
SELECT * from comp_tb ct --sorts in acending order
drop INDEX NCI_a ON comp_tb
create CLUSTERED INDEX CI_a ON comp_tb(a)
SELECT * from comp_tb ct -- sorts in acending order
drop INDEX CI_a ON comp_tb
So both clustered index as well as non-clustered index sorts data physically as soon as it created?
As per my reading only clustered index does physically sorting?