I just want to delete old data without archiving. When I allowed the following command, I seemed to query all the column before deleting them.
SELECT id
,uid
,createat
,releaseat
FROM xiehou
.table
FORCE INDEX(idx_createat
) WHERE (createAt < ‘2024-04-17 00:00:00’) ORDER BY createat
LIMIT 2000
DELETE FROM xiehou
.table
WHERE ((((‘2022-04-28 18:46:33’ IS NULL OR createat
>= ‘2022-04-28 18:46:33’)))) AND ((((‘2022-04-28 18:56:02’ IS NULL OR createat
<= ‘2022-04-28 18:56:02’)))) AND (createAt < ‘2024-04-17 00:00:00’) LIMIT 2000
How can I only perform the following operations
delete from xiehou
.table
WHERE (createAt < ‘2024-04-17 00:00:00’) ORDER BY createat
LIMIT 2000