Skip to content

refactor: shared projection rewrite plan as Option - #1902

Merged
murex971 merged 3 commits into
mainfrom
project-rewrite-refactor
Oct 27, 2026
Merged

murex971 merged 3 commits into
mainfrom
project-rewrite-refactor

Conversation

@murex971

@murex971 murex971 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Changes how the cross-shard projection rewrite plan is stored and passed around.

  • Route::projection_rewrite_plan and PostRouteRewrite::plan are now Option<Arc<ProjectionRewritePlan>> instead of an inline ProjectionRewritePlan.
  • On the common path (direct-to-shard queries, or no rewrite needed) the plan is None.
  • build only creates a plan when the rewrite added helper columns. ProjectionRewritePlan no longer derives Clone.

@murex971
murex971 requested a review from jkaczman October 27, 2026 08:45
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.46154% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/backend/pool/connection/aggregate.rs 95.83% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@murex971
murex971 added this pull request to stack #1903 October 27, 2026 08:57
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPgDog
Branchproject-rewrite-refactor
TestbedIntel v1
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s) x 1e3
(Result Δ%)
Lower Boundary
operations / second (ops/s) x 1e3
(Limit %)
cpu-per-txnBenchmark Result
Measure (units)
(Result Δ%)
Upper Boundary
Measure (units)
(Limit %)
pooler-v3📈 view plot
🚷 view threshold
16.99 ops/s x 1e3
(+0.00%)Baseline: 16.99 ops/s x 1e3
16.82 ops/s x 1e3
(99.00%)
📈 view plot
🚷 view threshold
40.77 units
(+0.29%)Baseline: 40.65 units
41.06 units
(99.30%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Metal bench failed. 1 of 150 measures outside bounds.

suite throughput cpu/txn user cycles/txn user instr/txn kernel cycles/txn ctx/txn
pooler 28.17 (-1.5% ± 0.8%) 27,863 (-1.3% ± 1.2%) 35,236 (-0.3% ± 0.02%) 38,941 (-1.9% ± 1.3%)
lb 29.19 (-1.9% ± 1.0%) 29,159 (-1.3% ± 1.3%) 36,091 (-0.3% ± 0.03%) 40,100 (-2.9% ± 1.6%)
sharding-w2 52.75 (+0.5%) 67,121 (+0.1%) 72,441 (-0.2%) 60,596 (+0.5%) 1.412 (-0.3%)
sharding-w8 159,545 (-0.9%) 45.6 (-0.2%) 65,483 (-1.6%) 56,139 (-0.2%) 51,899 (+1.5%) 0.1517 (+7.1%), bound +3%
Counters per txn
suite frontend stall l1i refill backend stall
pooler 13,774 (-2.2% ± 2.5%) 3,172 (-1.8% ± 1.1%) 2,669 (-0.4% ± 1.2%)
lb 14,474 (-2.4% ± 2.6%) 3,239 (-1.6% ± 1.2%) 2,951 (+0.4% ± 2.0%)
sharding-w2 38,457 (+1.8%) 5,371 (-0.0%) 6,672 (-5.4%)
sharding-w8 35,855 (-3.9%) 4,944 (-1.4%) 9,805 (+4.9%)

Microbench: all 135 measures within bounds.

  • extended_cached: 15 of 15 benches faster, median -4.3% ± 0.5%
  • extended_cold: 15 of 15 benches faster, median -4.1% ± 0.6%
  • simple_cold: 15 of 15 benches faster, median -4.7% ± 0.4%
lb flamegraph vs d74cf08

lb

Open interactive for hover, zoom and search.

lb removed

Open interactive.

microbench flamegraph vs d74cf08

microbench

Open interactive for hover, zoom and search.

microbench removed

Open interactive.

pooler flamegraph vs d74cf08

pooler

Open interactive for hover, zoom and search.

pooler removed

Open interactive.

sharding-w2 flamegraph vs d74cf08

sharding-w2

Open interactive for hover, zoom and search.

sharding-w2 removed

Open interactive.

sharding-w8 flamegraph vs d74cf08

sharding-w8

Open interactive for hover, zoom and search.

sharding-w8 removed

Open interactive.

Logs

lb, microbench, pooler, sharding-w2, sharding-w8, verdict.json

Compared 773bb04 with d74cf08.

Comment thread pgdog/src/frontend/router/parser/aggregate.rs Outdated
Comment thread pgdog/src/frontend/router/parser/rewrite/statement/projection.rs Outdated
@murex971
murex971 requested a review from jkaczman October 27, 2026 15:21
@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectPgDog
Branchproject-rewrite-refactor
TestbedIntel v1

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

🚨 3 Alerts

🐰 View full continuous benchmarking report in Bencher

@murex971
murex971 removed this pull request from stack #1903 October 27, 2026 15:50
@murex971
murex971 added this pull request to stack #1907 October 27, 2026 15:52
@murex971
murex971 merged commit 692b9d9 into main Oct 27, 2026
53 of 55 checks passed
@murex971
murex971 deleted the project-rewrite-refactor branch October 27, 2026 16:08
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.

2 participants