Part of the research plan for #4350 (see anchor comment there for the full decomposition).
Two prerequisites before touching any core code path: know which storages actually honor the hint, and be able to measure loads vs. round-trips so call-site choices are driven by numbers, not guesses.
All findings below are from a code scan of a Plone 6.2 coredev tree (2026-07-06); line numbers refer to the noted released versions.
Verified ground facts
ZODB.Connection.prefetch(*args) (ZODB 6.3, ZODB/Connection.py:1081) accepts oids (bytes), persistent objects (uses _p_oid), or iterables thereof. If the storage lacks prefetch, the method replaces itself with a no-op — calling it is unconditionally safe, no feature flag needed.
- The MVCC adapter forwards with the connection's tid (
ZODB/mvccadapter.py:192) — prefetch is connection-bound.
Part A — storage support matrix
Verify by code inspection plus one smoke test per storage:
Deliverable: support table posted to #4350 done — see the matrix comment below.
Part B — measurement harness and baseline
Deliverable: hotspot list ranked by measured wins — this ordering drives the sibling sub-issues.
Note for coredev: the current constraints pin zodb-pgjsonb 1.13.0; local benchmarking needs ≥ 1.15 (or RelStorage).
Part of the research plan for #4350 (see anchor comment there for the full decomposition).
Two prerequisites before touching any core code path: know which storages actually honor the hint, and be able to measure loads vs. round-trips so call-site choices are driven by numbers, not guesses.
All findings below are from a code scan of a Plone 6.2 coredev tree (2026-07-06); line numbers refer to the noted released versions.
Verified ground facts
ZODB.Connection.prefetch(*args)(ZODB 6.3,ZODB/Connection.py:1081) accepts oids (bytes), persistent objects (uses_p_oid), or iterables thereof. If the storage lacksprefetch, the method replaces itself with a no-op — calling it is unconditionally safe, no feature flag needed.ZODB/mvccadapter.py:192) — prefetch is connection-bound.Part A — storage support matrix
Verify by code inspection plus one smoke test per storage:
ClientStorage— ✅ implemented, per-oidloadBeforebut pipelined concurrently; smoke test: 50 cold misses → 0ANY(...)query (code inspection; local smoke pending, coredev pins 1.13.0)Deliverable:
support table posted to #4350done — see the matrix comment below.Part B — measurement harness and baseline
Connection.setstatecalls) vs. actual storage round-trips (wrapstorage.load*/ use storage-side tracing; zodb-pgjsonb per-span tracing is prior art — bluedynamics/zodb-pgjsonb#96). The ratio objects/queries ≈ 1 identifies N+1; ≫ 1 identifies batched.resolveuidreferences.Deliverable: hotspot list ranked by measured wins — this ordering drives the sibling sub-issues.
Note for coredev: the current constraints pin zodb-pgjsonb 1.13.0; local benchmarking needs ≥ 1.15 (or RelStorage).