sql - Is a clustered index faster than a non-clustered index with includes? -
this question has answer here:
i have table columns a,b,c,d,e,f,g has 500,000 rows.
there query gets run select * table = @a , b = @b , c = @c
.
is better create clustered index
on a, b, , c, or better off creating non-clustered index
on a, b, , c include (d, e, f, g)
.
not sure include speed query since select * issued.
any appreciated!
a clustered index fastest select
, may not correct choice.
a clustered index determines order in records physically stored (which why can have 1 per table). while fastest query, may slow down other queries , kill updates , inserts if 1 of columns changing, mean record need physically re-located.
an include again speed query @ expense of storage , index maintenance if of fields (including included fields) updated.
i start non-clustered index on a, b, , c , see if gets performance reasonable level. more trading speed in 1 area slowness in another.
Comments
Post a Comment