# Pt-archiver delete old data without first querying it

**URL:** <https://forums.percona.com/t/pt-archiver-delete-old-data-without-first-querying-it/29819>\
**Category:** MySQL & MariaDB\
**Tags:** mysql, percona, new-release\
**Created:** [April 24, 2024, 6:34am UTC](https://forums.percona.com/t/pt-archiver-delete-old-data-without-first-querying-it/29819 "2024-04-24T06:34:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seqwait](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/seqwait/32/12115_2.png) [@seqwait](https://forums.percona.com/u/seqwait)\
**Post date:** [April 24, 2024, 6:34am UTC](https://forums.percona.com/t/pt-archiver-delete-old-data-without-first-querying-it/29819/1 "2024-04-24T06:34:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 24, 2024, 5:22pm UTC](https://forums.percona.com/t/pt-archiver-delete-old-data-without-first-querying-it/29819/2 "2024-04-24T17:22:30Z")

</div>

@seqwait,  
Are you using `--purge` option?
