Skip to content

CNDB-17275 put using histograms estimations in query planner under flag#2290

Merged
pkolaczk merged 1 commit intomainfrom
rf-main-17275-query-estimator-flag
Apr 2, 2026
Merged

CNDB-17275 put using histograms estimations in query planner under flag#2290
pkolaczk merged 1 commit intomainfrom
rf-main-17275-query-estimator-flag

Conversation

@k-rus
Copy link
Copy Markdown
Member

@k-rus k-rus commented Mar 30, 2026

What is the issue

Fixes https://github.com/riptano/cndb/issues/17275

PR #1253 switched query planner to use histograms for rows estimations. This can change query plans in existing databases leading to different performance.

What does this PR fix and why was it fixed

To avoid such change during upgrade a flag, which controls using or not histograms, i.e., old vs new way of estimating rows, is introduced and set to FALSE by default.

The flag is set to TRUE for SAI tests.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 30, 2026

Checklist before you submit for review

  • This PR adheres to the Definition of Done
  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits
  • All new files should contain the DataStax copyright header instead of the Apache License one

@k-rus k-rus changed the title CNDB-17275 put using histograms estimations in query planner under flag [WIP] CNDB-17275 put using histograms estimations in query planner under flag Mar 30, 2026
@k-rus k-rus changed the title [WIP] CNDB-17275 put using histograms estimations in query planner under flag CNDB-17275 put using histograms estimations in query planner under flag Mar 31, 2026
@k-rus k-rus marked this pull request as draft March 31, 2026 14:39
@pkolaczk pkolaczk force-pushed the rf-main-17275-query-estimator-flag branch 2 times, most recently from e80af09 to 4ef160e Compare April 1, 2026 13:33
@pkolaczk pkolaczk marked this pull request as ready for review April 1, 2026 16:35
PR #1253 switched query planner to use histograms for rows
estimations. This can change query plans in existing databases leading
to different performance. To avoid such change during upgrade, a flag,
which controls using or not histograms, i.e., old vs new way of
estimating rows, is introduced and set to FALSE by default.
@pkolaczk pkolaczk force-pushed the rf-main-17275-query-estimator-flag branch from 4ef160e to 434d970 Compare April 2, 2026 11:50
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@cassci-bot
Copy link
Copy Markdown

❌ Build ds-cassandra-pr-gate/PR-2290 rejected by Butler


13 regressions found
See build details here


Found 13 new test failures

Test Explanation Runs Upstream
o.a.c.distributed.test.sai.SlowSAIQueryLoggerTest.testSlowSAIQueryLogger REGRESSION 🔴🔴 0 / 30
o.a.c.index.sai.QueryContextTest.testWideTableWithStatics[ba] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.EstimatedRowCountTest.testReturnedRowsEstimates[numShards=16, numPartitions=11] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.EstimatedRowCountTest.testReturnedRowsEstimates[numShards=2, numPartitions=11] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.EstimatedRowCountTest.testReturnedRowsEstimates[numShards=4, numPartitions=11] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.EstimatedRowCountTest.testReturnedRowsEstimates[numShards=64, numPartitions=10,000] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.EstimatedRowCountTest.testReturnedRowsEstimates[numShards=64, numPartitions=11] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.EstimatedRowCountTest.testReturnedRowsEstimates[numShards=8, numPartitions=1,000] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.EstimatedRowCountTest.testReturnedRowsEstimates[numShards=8, numPartitions=11] (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.cql.VectorCompaction100dTest.testZeroOrOneToManyCompaction[version=ec enableNVQ=false] REGRESSION 🔴🔴 0 / 30
o.a.c.index.sai.cql.VectorSiftSmallTest.testSiftSmall[version=fa enableNVQ=false enableFused=false] REGRESSION 🔴 0 / 30
o.a.c.index.sai.metrics.QueryMetricsTest.testQueryKindMetrics (compression) REGRESSION 🔵🔴 0 / 30
o.a.c.index.sai.plan.SingleRestrictionEstimatedRowCountTest.testMemtablesSAI (compression) REGRESSION 🔵🔴 0 / 30

Found 5 known test failures

@pkolaczk
Copy link
Copy Markdown

pkolaczk commented Apr 2, 2026

Sonar seems to have some problem with coverage analysis. I tested coverage manually and QueryController lines are covered by tests.

@pkolaczk pkolaczk merged commit 00e4dc9 into main Apr 2, 2026
1 of 4 checks passed
@pkolaczk pkolaczk deleted the rf-main-17275-query-estimator-flag branch April 2, 2026 14:29
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.

4 participants