Measure the artifact-level size lookup: base table, base table + INCLUDE (size), and the shadow table
Why
ADR-007 specifies blob_storage_blobs_by_namespace as the size source for artifact-level reconciliation, and validated that walk at ~0.6 ms for a single version. The base-table variant of the same walk was never measured at that scope, so there is no number behind the choice — only the reasoning that carried the namespace-wide sum, where the shadow turns a 64-partition scan into one (78 ms to 29 ms).
That reasoning does not obviously transfer. A per-version walk knows its digests before it looks up any size, so it issues a bounded number of equality probes on (namespace_id, sha256) rather than scanning. Partition count multiplies a scan; it does not multiply a seek. What the shadow still buys at this scope is index-only lookup (its primary key carries INCLUDE (size); the base table's unique index does not) and one partition instead of up to N.
Whether that is worth anything at 1-15 digests is currently an estimate on both sides. Two plans are choosing a source without it.
What to measure
The artifact-level walk — distinct blob_sha256 for one version, joined to its per-blob sizes — across three source options:
| # | Source | Index serving the probe |
|---|---|---|
| 1 | blob_storage_blobs as it stands |
unique_blob_storage_blobs_on_namespace_id_and_sha256, heap fetch for size |
| 2 | blob_storage_blobs with INCLUDE (size) added to that index |
index-only, partition per digest |
| 3 | blob_storage_blobs_by_namespace |
index-only, single partition |
Report EXPLAIN (ANALYZE, BUFFERS) for each: wall time, buffer hits, partitions touched. Use ADR-007's seeded dataset and cover both Maven (typically 4-15 files per version) and npm (1-3), plus a cold and a warm cache.
Variant 2 is measured, not built: adding INCLUDE to that index means rebuilding a unique index across 64 partitions, which is only worth planning if the numbers justify it.
Done when
- The three variants are measured and the numbers are recorded here.
- A recommendation states which source artifact-level reconciliation should use, and whether variant 2 is worth a migration.
- If the recommendation changes what a merged plan says, the follow-up MR is linked.
Context
- ADR-007,
#### Artifact-level storage accounting reconciliationand theBlob storage query examplessection. - The npm slice (#549 (closed)) joins
blob_storage_blobsdirectly, on the reasoning above. - The Maven plan (!1398 (merged)) currently specifies the shadow table for the same walk, which gates its step on unlanded S22 work.
This is a measurement, not a redesign: it does not block #549 (closed) or #550 (closed).