Assuming I would be doing an update on a column (of a 2M rows table)
that is not indexed. Is it a good idea to always create indexes
on a column that would always be involved in an update?
Cheers,
Randy
Printable View
Assuming I would be doing an update on a column (of a 2M rows table)
that is not indexed. Is it a good idea to always create indexes
on a column that would always be involved in an update?
Cheers,
Randy
Absolutely! Not having an index on that 2M rows will make your update statement to do full table scan to search for the column that you will be updating. Make sure you create an index on the column that you will be using in your 'where' clause.
Bad Idea of creating an index on a column that gets updated.
Tamil
If you are updating the whole table the index won't get used anyway. It will as tamilselvan implies, slow down the update, given that the index will need to be maintained.Quote:
Originally posted by randy
Assuming I would be doing an update on a column (of a 2M rows table)
that is not indexed. Is it a good idea to always create indexes
on a column that would always be involved in an update?
Cheers,
Randy