If I stop a long running query, does it rollback?

后端 未结 12 1902
忘了有多久
忘了有多久 2020-12-06 04:23

A query that is used to loop through 17 millions records to remove duplicates has been running now for about 16 hours and I wanted to know if the query is sto

12条回答
  •  醉梦人生
    2020-12-06 05:06

    Also try thinking another method to remove duplicate rows:

    delete t1 from table1 as t1 where exists (
        select * from table1 as t2 where
            t1.column1=t2.column1 and
            t1.column2=t2.column2 and
            t1.column3=t2.column3 and
            --add other colums if any
            t1.id>t2.id
    )
    

    I suppose that you have an integer id column in your table.

提交回复
热议问题