mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
Reviewed strfry's LMDB indices (golpe.yaml) against geode's SQLite set: the two are nearly isomorphic — time, id, kind+time, author+kind+time, tag+time, plus conditional deletion/expiration/replaceable entries (geode's are partial indexes, so ordinary events don't pay for them). Nothing to drop. One real hole: strfry maintains a plain pubkey(+created_at) index and geode had none, so an authors-only filter (no kinds) — archive pulls, account-migration tools, 'everything by these pubkeys' — degraded to a full walk of the time index. EXPLAIN confirmed: SCAN query_by_created_at_id. - quartz: IndexingStrategy.indexEventsByPubkeyAlone (default false — clients query their supported kinds and can skip it) gates a new query_by_pubkey_created index; DATABASE_VERSION 2→3 with an idempotent migration that backfills it for opted-in strategies. - geode: relayIndexingStrategy turns it on. - relayBench: new 'author-archive' scenario — every kind by 3 *quiet* pubkeys. Quiet is the point: prolific authors are dense in the time index and a scan finds them quickly, which is why the suite never caught this; sparse authors force the full walk. Measured (50k corpus): author-archive EOSE p50 42.8 ms -> 3.6 ms (12x, and the old path grows linearly with table size); ingest 5,337 -> 5,156 events/s (~3%, the one extra B-tree per event). strfry reference on the same scenario: 0.52 ms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NeoCvXnTxsKzqurkmjdC46