Performance tuning of UPDATE statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mani239
    New Member
    • Mar 2008
    • 1

    Performance tuning of UPDATE statement

    Below is the Update statement that i have to perform on Web_logins table which is having 21 million records.Is there any way to fine tune that query?

    Please suggest me..
    [code=mysql]
    update web_logins w set (last_login_dat e, login_count)=
    (select max(date_time), w.login_count + count(date_time ) from temp_login t
    where t.acct_nr=w.acc t_nr)
    where exists (select 'x' from temp_login t where w.acct_nr=t.acc t_nr)
    [/code]
    Index is created on acct_nr of web_logins before update statement.

    Thanks,
    Mani

    Please enclose your posted code in [code] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

    Please use [code] tags in future.

    MODERATOR
    Last edited by ronverdonk; Mar 25 '08, 11:29 AM. Reason: code tags
Working...