I have been asked the following question in an interview recently. Using clustered index in a table, which operation among insert, delete or update will be faster or slower?
asked Feb 18, 2014 at 7:52
-
And what did you answer?Raj– Raj2014年02月18日 07:53:10 +00:00Commented Feb 18, 2014 at 7:53
-
To some extent, it depends on what the clustered index is on - is it on real data column(s) or on an identity column?Damien_The_Unbeliever– Damien_The_Unbeliever2014年02月18日 07:54:46 +00:00Commented Feb 18, 2014 at 7:54
-
@Damien_The_Unbeliever,can you please explain more ?you mean in case of identity there is no page split .please explain.KumarHarsh– KumarHarsh2014年02月18日 08:05:44 +00:00Commented Feb 18, 2014 at 8:05
-
Indexes are created to enhance DQL querie (SELECT) and it has negative effect on DML (Insert, Delete and Update). If they did not give any real time scenario, I would say all the DML queries will have negative effect.Sandy– Sandy2014年02月18日 10:23:13 +00:00Commented Feb 18, 2014 at 10:23
1 Answer 1
The effect of indexes on DML queries is mostly negative ie more are the number of indexes created on table , slower is performance of an DML query like insert , update ,delete.
In fact , removing indexes while doing bulk load i.e inserting huge number of rows at same time is common practice. See here
answered Feb 18, 2014 at 8:31
Comments
lang-sql