Are non-clustered indexes slowing down inserts?

I am working on Sql Server 2005. I have an event log table that tracks user activity, and I want insertions into the table as fast as possible. The table currently has no indexes. Does adding one non-clustered index affect the insert? Or is it just cluster indexes that slow down inserts? Or should I just add a clustered index and not worry about it?

+4
source share
2 answers

Indexes, clustered or non-clustered, will always slow down insertions, since SQL must support both the table and the index. This slowdown is in the "absolute" sense, and you may not notice it. I would add what indexes are needed to retrieve your data.

+6
source

Yes, it will take a little time to keep up to date with the latest INSERT, UPDATE, DELETE operations for any index. The more indexes you have, the more time we talk.

But ultimately it depends on what is more important for you - good query performance (then add indexes as needed) or good insertion performance (while there are as few indexes as possible).

What operation do you perform more often?

+2
source

Source: https://habr.com/ru/post/1310789/


All Articles