PostgreSQL: pipeline the statements of a write batch #167

Merged
jcoffey-dev merged 1 commits from perf/pg-write-pipeline into main 2026-10-08 06:31:22 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 6e53461075 PostgreSQL: pipeline the statements of a write batch
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 7m45s
Upstream awaits each statement of a write batch before building the next,
which costs nothing on a single node and one network round trip each on
the cluster; a batch of a few hundred operations held the account's
change-id row locked for all of them. Statements that need no answer are
now sent as soon as they are built and their replies read later, in
order; PostgreSQL still runs them in the order sent. Operations that need
a reply to continue (asserts, merges, AddAndGet) drain the queue first,
so the first error reported is the real one. The change-id bumps for the
accounts in a batch go out together too.

Verified with the tests crate's store suite against PostgreSQL.
2026-10-07 22:55:41 -07:00