Skip to main content

prune

Function prune 

Source
pub fn prune(
    conn: &mut Connection,
    before_ts: i64,
    namespace: Option<&str>,
    generator: Option<&str>,
    actor: Option<&str>,
    dry_run: bool,
) -> Result<PruneReport, String>
Expand description

Deletes rows older than before_ts, optionally narrowed by namespace, generator or actor (all resolved through uid_meta). Runs in chunks of PRUNE_CHUNK rows in separate transactions, so registration and minting are never blocked behind one long-held writer lock — the measured reason a single DELETE was rejected (45.7s at 10M rows vs. a 0.38s worst chunk).

This deletes the only evidence an ID was issued: a pruned ID can be issued again without a collision being detected, and lookup answers unknown for an ID that was real. Callers must say so before confirming — see unv-cli/src/uid_cmd.rs and the /api/uid/prune handler.