Abstract

A query-result cache kept consistent with a PostgreSQL origin database by applying its logical replication stream lags the origin by the commit-to-apply window. A client connection that writes through the cache's proxy and immediately reads must not be served a cached result that omits its own write. A known per-connection read-after-write gate logs each forwarded write with an upper bound of its commit log sequence number sampled after the commit is confirmed, clears entries as the cache's applied watermark passes the bound, and forwards (never waits) any read it cannot prove disjoint from a pending write by comparing per-column value ranges of the two predicates. This disclosure describes five extensions that recover precision the base gate loses, each adding only provable-serve paths: write-side extraction of IN lists, BETWEEN and same-column OR as per-value tuples or set-valued ranges; serving a read that references none of an UPDATE's assigned columns regardless of predicate overlap; an extensional check that evaluates the pending write's predicate against the read's own cached rows, the write's pre-image, with one indexed probe on the cache database; per-column minimum/maximum envelopes over logged literals, used as an over-approximating summary on store overflow and as a constant-time prefilter on the serve path; and a bounded wait for the applied watermark to pass a stamped write's bound before forwarding. Uncertainty still forwards and no wait is unbounded.

Creative Commons License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.

Share

COinS