1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

doing a gaint 3 million row table query with inner join.

Discussion in 'MySQL' started by xbat, Feb 24, 2014.

  1. #1
    I have a giant table of 3 million that query's with another table something like this.

    UPDATE table1 t1
    INNER JOIN table2 t2
    ON 11.now =t2.ind_id
    AND t1.cat_mod=t2.kitty_mod
    SET t1.mice=t2.mice

    Any suggestions or ideas how to speed this up? so far its been running for 4 days now... I don't have any unique or primary or anything like that set..
     
    xbat, Feb 24, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Really? You have not put in anything that will help speed, yet you're suggesting just the things you need to do, more or less. 3million rows isn't that big, however, although if you're running an update on all rows, it will take a while anyway.
     
    PoPSiCLe, Feb 24, 2014 IP
  3. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Thank you.. yea I was just trying to collect ideas first.
     
    xbat, Mar 3, 2014 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    4 days are too much for just 3 million rows. Index the columns involved in JOIN i.e. 11.now, t2.ind_id, t1.cat_mod, t2.kitty_mod. This will speed up the process.
     
    mwasif, Mar 8, 2014 IP