我有一张有超过1000万行的大桌子.我需要更新以下行:
select *
from customers_card_psp
where status="not_added"
and psp_id = 2
order by id
limit 50000
因为我在customers_card_psp(psp_id, status)
上有一个复合索引,所以上面的查询执行得太快(不到1秒).但是,当我在UPDATE
查询中使用它作为子查询时,如下所示:
update customers_card_psp
set status = "failure"
where id in (select id
from customers_card_psp
where status="not_added"
and psp_id = 2
order by id
limit 50000)
它抛出:
#1235-此版本的MySQL尚不支持‘Limit&;IN/All/Any/Some子查询’
我如何解决这个问题?