##我的SQL
delete from tm_show.tm_ticket where ticketoid in (select * from qianjinyan_ticketOID);
###DBA的SQL
delete tm_ticket from tm_ticket inner join qianjinyan_ticketOID on tm_ticket.ticketoid = qianjinyan_ticketOID.tickrtoid;
上面一段是我的sql,因为存在脏数据,需要进行清理
执行了2h+还是没有执行成功
后来DBA提供了sql,20s+就删除了32万条数据
上次有更新操作,也是如此
update ticket_center.ticket_channel_item a
join ticket_center.tempticketID b on a.ticket_id = b.id
set a.total_stocks ='100',a.sold_stocks=2,a.locked_stocks=0,a.left_stocks=98;