shatteredsilicon / silicon-toolkit

GNU General Public License v2.0
0 stars 0 forks source link

st-archiver-purge.sql #1

Open gordan-bobic opened 4 months ago

gordan-bobic commented 4 months ago

Implement functionality of pt-archiver --purge - in pure SQL as a stored procedure. Initially, we will need only the following parameters, as they exist in pt-archiver:

--database
--source
--dest (initially only NULL until archiving part is implemented)
--where
--sleep
--commit-each
--txn-size

Should be implemented by using a single once-prepared statement, executed multiple times with EXECUTE ... USING ... for optimal performance.

This should make it significantly faster in some cases than pt-archiver, because it will evade the communication overhead between pt-archiver and the database.

jonathanvx commented 3 months ago

https://github.com/shatteredsilicon/silicon-toolkit/tree/st-archiver-purge.sql