# pg_local_cache whole-row benchmark

Generated: `2026-08-07T11:00:09.254103+00:00`

Every RESP target receives the same key stream and byte-identical per-key row JSON values.

## Full-row RESP GET

| Target | Median ops/s | Min-max ops/s | p99 | Errors |
|---|---:|---:|---:|---:|
| pg_local_cache | 143 104 | 143 104-143 104 | 0.415 ms | 0 |
| valkey | 194 910 | 194 910-194 910 | 0.266 ms | 0 |
| redis | 197 522 | 197 522-197 522 | 0.269 ms | 0 |

## Ordinary SQL whole-row/projection lanes

| Lane | Mapped PostgreSQL median ops/s | Stock PostgreSQL median ops/s |
|---|---:|---:|
| select_star | 123 707 | 65 867 |
| reordered_projection | 118 679 | 63 952 |
| composite_predicate_reordered | 126 550 | 68 746 |

## Ordinary SQL SELECT IN

| Keys / statement | Mapped key ops/s | Stock key ops/s | Mapped statements/s | Stock statements/s | Mapped/stock |
|---:|---:|---:|---:|---:|---:|
| 32 | 865 201 | 328 282 | 27 038 | 10 259 | 2.64x |

Key throughput counts returned unique primary-key rows, not SQL statements. Every timed mapped key must produce one transparent SQL cache hit with zero misses, fills, or bypasses.

## pg_local_cache full-row response-width sweep

| Text payload bytes | JSON response bytes | Median ops/s | p99 |
|---:|---:|---:|---:|
| 64 | 181-192 | 156 146 | 0.335 ms |
| 512 | 629-640 | 147 900 | 0.349 ms |
| 2048 | 2165-2176 | 126 125 | 0.499 ms |

Overall gate: **PASS** — all independent whole-row gates and integrity checks passed

RESP values are PostgreSQL `row_to_json` bytes. Valkey and Redis store exactly those bytes; pg_local_cache derives them from the authoritative table and maintains transactional invalidation.
SQL values are validated before timing. Prepared/pipelined pgbench uses identical SELECT text against mapped and stock PostgreSQL.
