DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: add index to an updat column

  1. #1
    Join Date
    Mar 2001
    Posts
    82

    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

  2. #2
    Join Date
    Jan 2001
    Location
    St. Louis. MO
    Posts
    151
    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.

  3. #3
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Bad Idea of creating an index on a column that gets updated.

    Tamil

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166

    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
  •  


Click Here to Expand Forum to Full Width