Should I index the column that I update the most?

Discussion in 'Databases' started by dreteh, Jun 18, 2010.

  1. #1
    Hello,

    I have a column in a table that gets updated very often(may be every second or more) and this column is used in many where clause in my queries. Should I index this column? Also, my database will eventually gets to more than 1 million records.

    Thank you.
     
    dreteh, Jun 18, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    It's not 100% certain without understanding your structure and usage, but most likely you would be better off with it indexed.
     
    jestep, Jun 18, 2010 IP
  3. bvsonline

    bvsonline Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, Surely indexing helps a lot in the overall performance of your mysql server.
     
    bvsonline, Jun 28, 2010 IP
  4. xtrecoolx

    xtrecoolx Greenhorn

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    Well sure it may help if you are making your selects based on that column but you should also consider the fact that indexing degrades your DB performance if you are inserting tons of data in that table.
     
    xtrecoolx, Jul 16, 2010 IP
  5. mrx345

    mrx345 Peon

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Indexing makes select quieries faster – so you will definetly need it cuz you have so many records…

    But it makes it slower (not that much though) for updated operations..

    I guess you need an index in your case
     
    mrx345, Jul 23, 2010 IP
  6. Deacalion

    Deacalion Peon

    Messages:
    438
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I once worked on a table that had over a million records that got hammered at certain times of the day.
    I messed around with indices on some of the columns, inserts became so slow that I ended up using the 'ignore' keyword so selects would continue working.

    It's hard to say what you would require without seeing the schema and what you need it to do.
     
    Deacalion, Jul 25, 2010 IP