Skip to content

Release 0.2.5 - #64

Merged
eldonm merged 2 commits into
mainfrom
fix/postgres-admission-performance
Nov 6, 2026
Merged

eldonm merged 2 commits into
mainfrom
fix/postgres-admission-performance

Conversation

@eldonm

@eldonm eldonm commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

PostgreSQL callers currently need no-op writes to serialize protected work, which unnecessarily makes compatible readers contend. This release adds transaction-scoped shared/exclusive record locks and logical-key advisory locks on the held connection without changing persisted data or authorization defaults.

Release notes

  • Transaction-scoped record and advisory locks on PostgreSQL. Shared locks admit concurrent peers while exclusive participants and record writes wait; locking existing records no longer requires a no-op write. Other adapters explicitly refuse these optional ordering guarantees.
  • Add pure Database.can_pushdown_numeric_sort compiler coverage so hosts can discover existing numeric ordering support through the public API; unsupported adapters refuse and wrappers delegate without caching. It certifies neither stored types nor access, and changes no existing SQL behavior.
  • Export Transaction through the supported top-level API and document lock lifecycle, tenancy, cancellation and host responsibilities.

This uses the documented patch exception in RELEASING.md: the additions are small, optional primitives with default exclusive mode and no change to existing calls, queries, data formats or security defaults. They fix unnecessary writes/contention without requiring adopter migration.

Validation

  • Full suite with PostgreSQL/pgvector: 2,771 passed, 111 skipped; coverage exceeds the 60% gate.
  • Pre-commit hooks passed, including formatting, lint, mypy and secret detection.
  • Wheel and sdist built; both passed twine check.
  • Real PostgreSQL tests prove shared peers coexist, exclusive participants wait for all peers, cancellation rolls back without leaking locks, and locks leave stored records unchanged.
  • Bound SQL, opening-tenant namespace, missing/closed records and unsupported-adapter refusal are covered.

Hosts must still evaluate current access, coordinate every relevant writer and keep a consistent lock order. Missing rows are not insertion fences; shared locks never grant permission.

@eldonm eldonm added the release Release preparation and publication label Nov 6, 2026
@eldonm
eldonm requested a review from barnwell November 6, 2026 11:47
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Benchmark comparison

Threshold: ±25% (informational, does not block merge)

benchmark baseline (s) current (s) delta status
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_deferred_save_batched_100 0.027647 0.012815 -53.6% IMPROVED (-53.6%)
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_immediate_save_100 0.026940 0.012735 -52.7% IMPROVED (-52.7%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[hierarchy] 0.004719 0.002169 -54.0% IMPROVED (-54.0%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[ontology] 0.004750 0.002178 -54.2% IMPROVED (-54.2%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[relationships] 0.004718 0.002141 -54.6% IMPROVED (-54.6%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[hierarchy] 0.003862 0.001943 -49.7% IMPROVED (-49.7%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[ontology] 0.003864 0.001936 -49.9% IMPROVED (-49.9%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[relationships] 0.003842 0.001943 -49.4% IMPROVED (-49.4%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_batched_saves_500 0.489869 0.386403 -21.1% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_empty_query 0.002114 0.001346 -36.3% IMPROVED (-36.3%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_filtered 0.103205 0.059163 -42.7% IMPROVED (-42.7%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_find_filtered 0.105505 0.061279 -41.9% IMPROVED (-41.9%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_save_throughput 0.001690 0.001513 -10.5% OK
tests/benchmarks/test_postgres_benchmarks.py::test_bench_postgres_find_many_bulk 0.001082 0.000553 -48.8% IMPROVED (-48.8%)
tests/benchmarks/test_postgres_benchmarks.py::test_bench_postgres_traverse_depth 0.000649 0.000291 -55.2% IMPROVED (-55.2%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_empty 0.000275 0.000122 -55.6% IMPROVED (-55.6%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_fallback_via_regex 0.030673 0.017065 -44.4% IMPROVED (-44.4%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_pushdown 0.001479 0.000779 -47.4% IMPROVED (-47.4%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_fallback_via_regex 0.031478 0.016642 -47.1% IMPROVED (-47.1%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_pushdown 0.000448 0.000228 -49.1% IMPROVED (-49.1%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_sort_limit_pushdown 0.002546 0.001467 -42.4% IMPROVED (-42.4%)

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Benchmark comparison

Threshold: ±25% (informational, does not block merge)

benchmark baseline (s) current (s) delta status
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_deferred_save_batched_100 0.027647 0.025976 -6.0% OK
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_immediate_save_100 0.026940 0.025099 -6.8% OK
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[hierarchy] 0.004719 0.004304 -8.8% OK
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[ontology] 0.004750 0.004275 -10.0% OK
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[relationships] 0.004718 0.003936 -16.6% OK
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[hierarchy] 0.003862 0.003559 -7.8% OK
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[ontology] 0.003864 0.003745 -3.1% OK
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[relationships] 0.003842 0.003727 -3.0% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_batched_saves_500 0.489869 0.515175 +5.2% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_empty_query 0.002114 0.001912 -9.6% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_filtered 0.103205 0.096364 -6.6% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_find_filtered 0.105505 0.096325 -8.7% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_save_throughput 0.001690 0.001801 +6.6% OK
tests/benchmarks/test_postgres_benchmarks.py::test_bench_postgres_find_many_bulk 0.001082 0.001098 +1.5% OK
tests/benchmarks/test_postgres_benchmarks.py::test_bench_postgres_traverse_depth 0.000649 0.000619 -4.6% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_empty 0.000275 0.000274 -0.3% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_fallback_via_regex 0.030673 0.030580 -0.3% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_pushdown 0.001479 0.001481 +0.2% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_fallback_via_regex 0.031478 0.030601 -2.8% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_pushdown 0.000448 0.000421 -6.0% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_sort_limit_pushdown 0.002546 0.002563 +0.7% OK

@eldonm
eldonm merged commit 906ba36 into main Nov 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Release preparation and publication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant