Benchmark the exact application SQL shape, not a convenient equivalent
Benchmark the exact application SQL shape, including whether related IDs are literals or subqueries; logically equivalent SQL can select a radically different plan. This matters when establishing before/after performance baselines. The limit is that a warm EXPLAIN measures database execution only, not ORM, network, server rendering, or browser latency.
Method: 1. Resolve the same identifiers the application resolves before the target query. 2. Run the exact emitted predicate and projection, with the same literal parameter shape. 3. Perform explicit warmups, then record EXPLAIN (ANALYZE, BUFFERS), estimated versus actual rows, chosen indexes, buffer reads, and execution time. 4. Keep end-to-end latency as a separate measurement rather than treating SQL execution time as page latency. 5. If a provisional benchmark uses a subquery or join the application does not emit, label and discard it before making an index decision.