Skip to content

version3.7.0 release#35

Merged
MaxAkbar merged 11 commits into
mainfrom
version3.7.0
May 9, 2026
Merged

version3.7.0 release#35
MaxAkbar merged 11 commits into
mainfrom
version3.7.0

Conversation

@MaxAkbar
Copy link
Copy Markdown
Owner

@MaxAkbar MaxAkbar commented May 9, 2026

Summary

This version3.7.0 release completes the current optimizer and async I/O
close-out work, adds public planner observability, introduces opt-in adaptive
join reoptimization, and fixes the view/query paths that motivated the
customer-filtered fulfillment investigation.

The query-planning work adds EXPLAIN ESTIMATE and sys.planner_* diagnostic
catalogs, then exposes those diagnostics in the Admin Query tab. It also adds
phase-one adaptive join reoptimization behind explicit opt-in settings so
eligible index nested-loop and hash joins can correct bad cardinality
assumptions before rows are emitted while default query behavior remains
unchanged.

The view/admin work makes paged view browsing use bounded LIMIT/OFFSET
plans, lets simple view row-goal planning reorder eligible join chains before
the view operator tree is built, fixes Query tab grid scrolling, and preserves
SQL column type metadata across engine, API, client, and Admin result surfaces.

The release also closes the current generated collection fast-path and DataGen
direct-load phase, refreshes release benchmark docs and scorecards, adds
optimizer/async I/O close-out diagnostics, and adds a dedicated WAL point-read
benchmark plus configurable guardrail metric comparison for sub-microsecond
latency rows.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor / maintenance
  • Tests only

Related Issues

No issue numbers were linked for this release branch. Included work:

  • Added public planner diagnostics through EXPLAIN ESTIMATE FOR SELECT, WITH,
    and compound queries.
  • Added sys.planner_* virtual catalogs for histograms, heavy hitters, and
    composite index prefix statistics.
  • Added Admin Query tab estimate execution and Plan tab rendering.
  • Added opt-in adaptive query reoptimization through DatabaseOptions,
    EnableAdaptiveQueryReoptimization(...), and direct embedded ADO.NET
    connection strings.
  • Added adaptive join diagnostics and fail-closed handling for unsupported or
    risky shapes.
  • Added row-goal reordering for eligible simple view join chains.
  • Updated Admin DataGrid view paging to issue bounded LIMIT/OFFSET SQL.
  • Fixed Query tab grid scrolling and pager layout.
  • Improved lookup-join planning for indexed local predicates, residual
    right-side filters, and index scan capacity hints.
  • Propagated SQL result ColumnTypes through local engine transport, HTTP API,
    HTTP client, and Admin DataGrid.
  • Added a fulfillment sample orders(customer_id) lookup index.
  • Closed the current generated collection fast-path phase and refreshed related
    roadmap/static pages.
  • Moved DataGen direct loads onto the write-optimized storage preset and
    reduced direct-load row-buffer overhead.
  • Added optimizer close-out and async I/O close-out diagnostic benchmark suites.
  • Refreshed release benchmark README tables, benchmark catalog entries, and the
    release-core manifest with the May 6 baseline.
  • Added a WAL point-read BenchmarkDotNet suite and guardrail support for
    comparing latency columns such as P95 instead of only Mean.

Testing

  • dotnet build CSharpDB.slnx
  • Relevant tests executed
  • Failure-path tests executed (if applicable: cancellation, invalid/unsupported inputs, non-DbException paths)
  • Manual verification performed (if applicable)

Validation reported across the commit range:

  • dotnet test .\CSharpDB.slnx -c Release
  • dotnet build .\CSharpDB.slnx -c Release --no-restore
  • dotnet test .\CSharpDB.slnx -c Release --no-build
  • dotnet run -c Release --project .\tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -- --optimizer-closeout --repro
  • dotnet run -c Release --project .\tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -- --async-io-closeout --repro
  • pwsh -NoProfile .\tests\CSharpDB.Benchmarks\scripts\Run-Perf-Guardrails.ps1 -Mode release
    • Reported PASS=187, WARN=0, SKIP=0, FAIL=0.
  • dotnet build .\src\CSharpDB.Admin\CSharpDB.Admin.csproj -c Release
  • dotnet test .\tests\CSharpDB.Admin.Forms.Tests\CSharpDB.Admin.Forms.Tests.csproj -c Release --filter FullyQualifiedName~DataGridTests
  • dotnet test .\tests\CSharpDB.Tests\CSharpDB.Tests.csproj -c Release --filter FullyQualifiedName~SimpleViewLateUnindexedDetailJoinWithLimit|FullyQualifiedName~JoinChainWithLimit|FullyQualifiedName~PurchaseOrderLineJoinChainWithLimit
  • Targeted generated collection tests, trim smoke publish, DataGen Release
    build, relational direct-load smoke, and document direct-load smoke.
  • dotnet build tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -c Release --no-restore
  • dotnet run -c Release --project tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -- --micro --filter *WalPointReadBenchmarks* --job Dry
  • Focused lookup-join and SQL column type tests for:
    Join_WithWhereOnRightPrimaryKeyLookupSide_AppliesPredicate,
    Join_WithUniqueTextFilterAndIndexedDependentSide_UsesLookupJoins, and
    ExecuteSqlAsync_ReturnsQueryColumnTypes.

Checklist

  • I followed the project style and conventions.
  • I added or updated tests for behavior changes.
  • I covered both success and failure paths for changed behavior.
  • I updated docs for user-facing changes.
  • I verified no sensitive data was added.

Notes for Reviewers

  • Adaptive reoptimization is opt-in. Default query planning and execution remain
    unchanged unless a host enables the feature.
  • Remote endpoint connection strings reject the adaptive reoptimization key;
    remote hosts must enable the feature server-side.
  • EXPLAIN ESTIMATE and sys.planner_* are public diagnostic surfaces and
    should stay isolated from normal select execution side effects.
  • Simple view row-goal planning is intentionally scoped to eligible join chains
    and bounded browsing shapes.
  • The SQL result ColumnTypes DTO addition is additive, but client/UI consumers
    should handle missing values from older servers.
  • The WAL point-read benchmark gives future releases a cleaner signal, but it
    does not yet have a historical baseline captured as a guardrail.

MaxAkbar added 11 commits May 5, 2026 13:26
Add row-id range reservations for concurrent implicit inserts, track pending WAL page images, and rebase hot right-edge leaf inserts against pending commits so one-row concurrent insert workloads can build durable flush fan-in.

Update insert fan-in diagnostics, benchmark guardrails, tests, and docs for hot explicit right-edge, auto-ID, and disjoint explicit-key shapes.

Validation: dotnet test .\CSharpDB.slnx -c Release; dotnet run --project .\tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -c Release -- --insert-fan-in-diagnostics --repro; dotnet run --project .\tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -c Release -- --strict-insert-compare --repro.
Close the current Advanced cost-based query optimizer and Async I/O batching roadmap phases as completed current-phase work, while keeping adaptive re-optimization and public histogram inspection as separate planned items.

Add optimizer close-out diagnostics for heavy-hitter equality, histogram range estimates, composite-prefix correlation, and bounded join reordering. Add async I/O close-out diagnostics for save/backup/restore, vacuum and FK logical rewrites, database inspector scans, and live WAL inspector scans.

Refresh roadmap, query/durable-write docs, async I/O audit notes, benchmark catalog, README close-out tables, and release-core manifest metadata with the May 6 guardrail pass.

Validation: dotnet test .\CSharpDB.slnx -c Release; dotnet run -c Release --project .\tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -- --optimizer-closeout --repro; dotnet run -c Release --project .\tests\CSharpDB.Benchmarks\CSharpDB.Benchmarks.csproj -- --async-io-closeout --repro; pwsh -NoProfile .\tests\CSharpDB.Benchmarks\scripts\Run-Perf-Guardrails.ps1 -Mode release (PASS=187, WARN=0, SKIP=0, FAIL=0).
Mark the current source-generated collection fast-path phase as done, split package ergonomics and broader generator coverage into future roadmap items, and sync the static roadmap pages.

Refresh benchmark-facing docs with the current release-core snapshot, generated collection codec diagnostics, and root README performance tables including SQLite reference rows.

Move CSharpDB.DataGen direct loads onto the write-optimized storage preset, reuse SQL row buffers before InsertBatch copies, document the fast-path choices, and cap direct collection document target sizes to stay within the current inline collection payload envelope.

Validation: targeted generated collection tests passed; trim smoke publish and executable passed; DataGen Release build passed; relational and document direct-load smoke runs passed; git diff --check passed with only existing line-ending normalization warnings.
Teach row-goal planning to reorder eligible simple view join chains before the view operator tree is built. This lets bounded LIMIT/OFFSET queries over views use the same streaming lookup plans as equivalent inline SQL, including views whose original join order reaches an unindexed detail table late.

Update the Admin DataGrid view path to page views with bounded LIMIT/OFFSET instead of opening unbounded forward-only view cursors. This keeps view tabs responsive when moving across pages and avoids forcing full-startup join plans for simple browsing.

Restructure the shared DataGrid markup and query tab CSS so the row grid is the only scroll container and the pagination bar stays fixed below the rows. This removes the double-scrollbar/pager clipping issue in Query results while preserving table/view grid behavior.

Add regression coverage for bounded simple-view row-goal planning, late unindexed detail joins, purchase-order style join chains, and DataGrid view paging SQL generation.

Validation run: dotnet build .\src\CSharpDB.Admin\CSharpDB.Admin.csproj -c Release; dotnet test .\tests\CSharpDB.Admin.Forms.Tests\CSharpDB.Admin.Forms.Tests.csproj -c Release --filter FullyQualifiedName~DataGridTests; dotnet test .\tests\CSharpDB.Tests\CSharpDB.Tests.csproj -c Release --filter FullyQualifiedName~SimpleViewLateUnindexedDetailJoinWithLimit|FullyQualifiedName~JoinChainWithLimit|FullyQualifiedName~PurchaseOrderLineJoinChainWithLimit.
Promote the May 6 release-core benchmark artifacts in the release-core manifest and regenerate the benchmark README from that manifest.

Sync the root README headline, durable API, concurrent write, and SQLite comparison tables to the new baseline. Also surface the latest focused insert fan-in diagnostic rows so the right-edge and auto-ID concurrent insert improvements are visible while still marked diagnostic until the release-core suite covers those shapes directly.
Expose SQL-first planner diagnostics through sys.planner_* virtual catalogs and EXPLAIN ESTIMATE FOR SELECT/WITH/compound queries.

- add parser, tokenizer, AST, read-only classification, prepared-statement, and shared-memory handling for EXPLAIN ESTIMATE

- materialize stable public projections for planner histograms, heavy hitters, and composite index prefix stats

- add bounded planner estimate diagnostics for stats freshness, lookup/filter estimates, index choices, hash build-side selection, and join reorder decisions without polluting normal select planning

- wire Admin Query tab Estimate action and Plan tab rendering for diagnostic rowsets

- add parser/catalog/planner/client/HTTP tests plus benchmark coverage for planner diagnostics

- document how to read Plan output, debug missing/stale stats, and identify likely query-planning red flags

Validation:

- dotnet build .\CSharpDB.slnx -c Release --no-restore

- dotnet test .\CSharpDB.slnx -c Release --no-build
Add the phase-one adaptive query reoptimization surface behind
DatabaseOptions.AdaptiveQueryReoptimization, keeping default query behavior
unchanged. Direct embedded hosts can opt in through
EnableAdaptiveQueryReoptimization, and ADO.NET direct embedded connections can
use Adaptive Query Reoptimization=true when explicit DirectDatabaseOptions are
not supplied. Remote endpoint connections reject the key so hosts enable the
feature server-side.

Wire adaptive options through Database, ReaderSession, QueryPlanner, and direct
connection pooling. Add internal diagnostics for eligible queries, attempts,
successful switches, rejected switches, divergence events, buffered rows, and
fail-closed fallback reasons.

Add adaptive join wrappers for the current v1 scope:
- index nested-loop joins can buffer the outer side and switch to hash join
  before emitting rows when observed outer cardinality diverges
- inner hash joins can flip the build side before emitting rows when the
  planned build side is materially larger than estimated
- unsupported or risky shapes keep the original plan

Keep plan caches value-agnostic and suppress adaptation for unsupported shapes
such as compound query children, correlated subquery execution, cross/right
joins, and SELECT * cases where visible column order could change.

Add focused engine/operator tests, ADO.NET option tests, and an
AdaptiveReoptimizationBenchmark diagnostic suite. Update benchmark docs,
roadmap, and query-performance guidance to document phase-one behavior,
expected workload-shaped gains, and future runtime actuals / EXPLAIN ANALYZE
work.
Add a BenchmarkDotNet WAL point-read benchmark that measures primary-key reads across WAL-backed and checkpointed states for 100, 1k, 5k, and 10k target frames.

Teach Compare-Baseline.ps1 to compare a configurable time metric per check or override via metricColumn, while keeping Mean as the default and surfacing the selected metric in console and markdown reports.

This gives the WAL stress investigation a stable micro signal and lets sub-microsecond WAL latency rows be evaluated on latency metrics such as P95 instead of only Mean/throughput-derived behavior.

Verified with: dotnet build tests/CSharpDB.Benchmarks/CSharpDB.Benchmarks.csproj -c Release --no-restore; Compare-Baseline.ps1 parser smoke; temp P95 metric-column smoke; dotnet run -c Release --project tests/CSharpDB.Benchmarks/CSharpDB.Benchmarks.csproj -- --micro --filter *WalPointReadBenchmarks* --job Dry
Propagate SQL result column types through the engine transport, HTTP API/client DTOs, and admin data grid so view/query result metadata is preserved across local and remote execution paths.

Improve lookup-join planning by using indexed local predicate estimates when cardinality stats are unavailable or weaker, preserving right-side local predicates as residual join filters, and passing estimated row counts into index scans as capacity hints.

Add an orders(customer_id) lookup index to the fulfillment sample schema for customer-filtered order views.

Cover the behavior with integration tests for right-side join predicates and unique-text-filter lookup joins, plus a client SQL execution test for returned column types.

Verified with focused dotnet test coverage for the two lookup-join tests and ExecuteSqlAsync_ReturnsQueryColumnTypes.
Replace RELEASE_NOTES.md with a single version3.7.0 section covering planner observability, adaptive reoptimization, paged view planning, SQL result metadata, DataGen close-out, and benchmark updates.

Add docs/releases/v3.7.0-pr-notes.md using the repository PR template, with summary, scope, validation, and reviewer notes derived from b416b21..HEAD.

Verified with: git diff --check -- RELEASE_NOTES.md docs/releases/v3.7.0-pr-notes.md
@MaxAkbar MaxAkbar marked this pull request as ready for review May 9, 2026 21:55
@MaxAkbar MaxAkbar merged commit 5d14742 into main May 9, 2026
8 checks passed
@MaxAkbar MaxAkbar deleted the version3.7.0 branch May 9, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant