Speed up the prune migration
kderme opened this issue · comments
Let's say we run the prune
migration on a db which is close to being fully synced. The prune migration initially runs the consumed migrations, which marks all consumed tx_out
and then it deletes all the old enough tx_out
. It could become faster by directly deleting the old enough consumed tx_out
, instead of doint it in 2 steps.
So instead of running in runExtraMigrations
migrateTxOut
deleteConsumedTxOut
These can be run as
deleteConsumedTxOut' -- different from the above
migrateTxOut
@kderme just a couple of question for clarification:
runExtraMigrations
happens here inside of runSyncNode
which happens once. deleteConsumedTxOut
happens at an interval of every epoch here.
-
Is the idea to
deleteConsumedTxOut
just beforerunExtraMigrations
? -
If so you mention the function deleteConsumedTxOut should be different how so?
Other usages of deleteConsumedTxOut
shouldn't be affected by this. Only 1 of the 2 usages of deleteConsumedTxOut
in runExtraMigrations
should change its behaviour. Basically it should work without the need of running migrateTxOut
and creating the extra column before it.