-
add index to an updat column
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
-
Re: add index to an updat column
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
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|