Just only delete with query

i just want delete table row by where without query

example user_login_record i just want delete by login_at
“delete from user_login_record where login_at < ‘2022-10-10’” without query just delete by where

what should I do? :sob:

Hello @seqwait,
Can you provide more info? Are you trying to use a Percona Toolkit tool? If so, which tool? What command have you tried so far?

the command , i just want execute "delete from table where date < ‘date’ " no query, just only delete no query first .

pt-archiver --source D=${DB},t=${table},A=utf8mb4,i=idx_date \
  --where "date < '${bound}'" \
  --progress=${RN} \
  --txn-size=${TXN} \
  --bulk-delete \
  --limit=${RN} \
  --local \
  --purge \
  --sleep=1 \
  --statistics

What you have is exactly what you need. What is happening that is wrong?

Try running with PTDEBUG=1 pt-archiver ... to see much more SQL

it seem the above command first exec “select xx from table” fist the exec “delete from table where …”
i just want exec "delete table " no query fist. how ?

This is the default way of pt-archiver working steps. You can check more details about this under --limit option.

–limit

type: int; default: 1

Number of rows to fetch and archive per statement.

Limits the number of rows returned by the SELECT statements that retrieve rows to archive. Default is one row. It may be more efficient to increase the limit, but be careful if you are archiving sparsely, skipping over many rows; this can potentially cause more contention with other queries, depending on the storage engine, transaction isolation level, and options such as --for-update.