New: prepared statements, UPDATE and DELETE, and key lookups that seek — 0.143 ms through the gateway.Read the update

Benchmark report · SQL gateway

SQL through the gateway: first latency

First pgbench runs through the gateway: a one-row insert takes about 1 ms, but a primary-key lookup costs as much as a GROUP BY and nothing scales with clients.

Run details

Date
Commit2c4c91a
Hoststtiz, shared production VPS under the uf-remote caps: 3 CPUs, 6 GB.
ToolUF_BENCH=1 bash scripts/p3a-e2e-host.sh under uf-remote. Path: pgbench 16, simple protocol, loopback TCP → ufgw → Unix socket → ufd --jwks. Data: the end-to-end tables (tenant A: 10 000 orders; tenant B: 100), 10 s per run.
Raw results
No separate raw file; the figures are those printed by pgbench in the run and recorded in the report.
Reportdocs/bench/2026-10-23-p3a-sql.md

Indicative only. Measured on a shared development host with other services running, one node, data that fits in memory. These figures show direction, not performance to expect. The claims policy requires a dedicated host before any target is published.

Results

The tables, as written

Transcribed from the report without rounding. Bracketed values are the previous measurement where the report gives one.

pgbench, simple protocol, 10 s per run

StatementClientsLatency avg (ms)Statements/sFailed
SELECT amount, status FROM orders WHERE id = :id15.521810
same841.71920
SELECT status, count(*), sum(amount) FROM orders GROUP BY status15.641770
same842.21900
INSERT INTO orders … VALUES (…) (one row)11.069470
same86.801 1760

Average latency, ms, log scale

One client and eight clients per statement; simple protocol

1 client 8 clients
1101 client PK lookup: 5.52 ms8 clients PK lookup: 41.7 msPK lookup1 client GROUP BY: 5.64 ms8 clients GROUP BY: 42.2 msGROUP BY1 client INSERT: 1.06 ms8 clients INSERT: 6.8 msINSERT
What changed

Before and during this run

  • The gateway ufgw (PostgreSQL wire protocol, simple protocol), token login checked at the gateway and at the node, a hidden tenant column, and the first SQL subset.
Reading

What the numbers say

The report's own reading, including what went wrong and what is still open.

  • A primary-key lookup costs as much as a full GROUP BY. There was no key seek yet: every plan read the tenant's whole key range and filtered. For OLTP this was the first thing to fix (P3b).
  • Queries do not scale with clients. ufd ran every request on one engine thread, so 8 clients got the same throughput as 1 with 8× the latency. Concurrent read execution at a snapshot is the second item.
  • The gateway path itself is cheap: a one-row insert, which also fetches the catalog, parses and binds, takes about 1 ms end to end.
Reproduce

Files and tools

Report

docs/bench/2026-10-23-p3a-sql.md in the repository.

Raw results

No separate raw file; the figures are those printed by pgbench in the run and recorded in the report.

Access

The repository is private during development. Early-access teams receive the build, the benchmark scripts and the raw files.

See the measurements in context.

The performance page draws the latest figure from each area and states what is not measured yet.