# liqlock.db prune plan (exec, 29 Oct) - main /opt/pricepredict-data/liqlock.db 13.5G
Correction: crewmap.py live only READS liqlock.db (writes crew.db, 150M). The writer is liqinc.py (cron :23 hourly, flock, scan_one) plus the one-time liqlock.py/liqbuild2.py build. Disk main: 87% (11G free), under 90% limit.
Tables: ml(b,li,pool,tx,sender,tl,tu,dl,salt) 28M rows = raw ModifyLiquidity for ALL v4 pools; nft 6.4M raw position-NFT transfers; saltmap 3.6M (salt->tid, rebuildable from ml); plus lock/poolfam/bsell/v4init (small).
Readers of ml: hist/knowbt, wash, crewgrade, kb_patch (per pool dl), fm/edge_extract(2) (block range), liqinc (blocks > last), liqlock/liqbuild2 (full rebuild only).
Plan (nothing run; table owner = dataeng decides):
1. Keep forever: lock, poolfam, bsell, v4init, hookfp, btime, kv (derived, small).
2. ml: pools that never passed a launch gate (junk families, dl small) are the bulk. Archive rows with b older than 30 days AND pool not in poolfam-selected/picked/runner sets to ml_archive.db.zst (zstd -19, expect ~8x), then DELETE + wal checkpoint + VACUUM into a new file (VACUUM needs ~size of result free, ok at 11G if result <9G; do in a copy, swap with liqinc paused via flock).
3. nft: keep rows for tids whose pool is in lock with non-junk fam; archive rest the same way. liqinc needs only history of tids touched in new blocks, so keep nft for tids seen in the last 30 days too.
4. saltmap: drop and rebuild lazily only for kept ml (SELECT DISTINCT salt FROM ml WHERE sender=POSM).
5. Safety: zstd archive first, verify row counts, pause via `flock /tmp/liqinc.lock`, keep .bak until readers (edge_extract, wash) run OK once. Expected saving 8-10G.
Cheapest immediate step if disk gets tight: zstd the whole DB to another volume copy is not needed; step 4 alone frees ~0.3-0.5G.

## Measured (dbstat, MB): ml 8156, ml_pool index 2264, nft 1150, v4init 357, poolfam 331, saltmap 299, nft_tid 97. Row counts match the ops task (ml 27.96M, nft 6.40M, saltmap 3.61M).
- saltmap is only 0.3G, so step 4 saves little; the real wins are ml (8.2G) and its ml_pool index (2.3G).
- `lock` table has 0 rows right now (derived table, rebuilt by liqlock.py); check this is expected before relying on it.
