Repository navigation
Keep the IN selectivity estimation bound under old compatibility - #118095
Conversation
The settings changes history entry for `statistics_max_set_size_for_exact_selectivity_estimation` had 0 as the previous value, so `compatibility` with 26.6 or an earlier version restored the uncapped estimation, which can add hundreds of milliseconds to the planning of a single query. Related: #116137 Related: #114389
|
Workflow [PR], commit [4ac9d78] Summary: ❌
AI ReviewSummaryThis PR turns the Findings
Tests
Final Verdict
LLVM Coverage ReportMeasured on commit 4ac9d78.
Changed lines: Changed C/C++ lines covered: 26/26 (100.00%) · Uncovered code |
The entry is a no-op for `compatibility` (previous value equals the new one), but having it in every version block from 26.6 on makes the backports to the 26.6, 26.7 and 26.8 branches land in the block that exists there.
| {"join_algorithm", "direct,parallel_hash,hash", "direct,parallel_hash,hash,ie_join", "Appended `ie_join` to the default list, so a join whose `ON` section has only inequality conditions is executed with IEJoin instead of a `CROSS JOIN` with a filter. Being last, it is used only when the other algorithms do not apply."}, | ||
| {"unique_key_probe_implementation", "auto", "auto", "New setting: selects the UNIQUE KEY probe implementation (currently only the simple baseline exists)"}, | ||
| {"statistics_max_set_size_for_exact_selectivity_estimation", 0, 10000, "New setting to bound the cost of estimating the selectivity of `IN` with a large set: above the limit the estimator uses the size of the set and its bounding range instead of the exact ranges. Before 26.8 the estimation was uncapped, so the previous value is 0 (no limit) and `compatibility` with an earlier version restores the exact ranges for sets of any size."}, | ||
| {"statistics_max_set_size_for_exact_selectivity_estimation", 10000, 10000, "New setting to bound the cost of estimating the selectivity of `IN` with a large set: above the limit the estimator uses the size of the set and its bounding range instead of the exact ranges. The previous value is deliberately equal to the new one, so that `compatibility` with an earlier version keeps the bound instead of restoring the uncapped estimation, which could add hundreds of milliseconds to the planning of a single query."}, |
There was a problem hiding this comment.
This changes the compatibility behavior of a concrete user-visible setting, but the final revision no longer has any focused regression test for it. Right now nothing in CI proves that statistics_max_set_size_for_exact_selectivity_estimation still stays at 10000 under compatibility = '26.7' / '26.6', or that an explicit statistics_max_set_size_for_exact_selectivity_estimation = 0 still overrides compatibility as intended.
A tiny stateless test against system.settings or getSetting would close that gap.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 10 s compile time in total, 7 of them have a recent master baseline. |
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
Preserve both the compatibility bound and the new settings history entries. Related: #118095
The cherry-pick resolution imported master's whole 26.7, 26.8 and 26.9 settings-history sections. They name 153 settings that do not exist on 26.6, so applyCompatibilitySetting() threw UNKNOWN_SETTING for every `SET compatibility`, and servers with `compatibility` in a profile exited with code 115 at startup. 26.6 already declares the setting in its own 26.6 section, so the backport is just the previous value 0 -> 10000 on that entry. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The cherry-pick resolution imported master's whole 26.8 and 26.9 settings-history sections. They name settings that do not exist on 26.7, so applyCompatibilitySetting() threw UNKNOWN_SETTING for every `SET compatibility`, and servers with `compatibility` in a profile exited with code 115 at startup. What is left is the original change itself: previous value 0 -> 10000 on the declaring entry, plus the two no-op entries in the 26.7 and 26.6 sections. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The cherry-pick resolution imported master's whole 26.9 settings-history section. It names settings that do not exist on 26.8, so applyCompatibilitySetting() threw UNKNOWN_SETTING for every `SET compatibility`, and servers with `compatibility` in a profile exited with code 115 at startup. What is left is the original change itself: previous value 0 -> 10000 on the declaring entry, plus the two no-op entries in the 26.7 and 26.6 sections. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Backport #118095 to 26.8: Keep the IN selectivity estimation bound under old compatibility
…der old compatibility
…der old compatibility
Backport #118095 to 26.7: Keep the IN selectivity estimation bound under old compatibility
Backport #118095 to 26.6: Keep the IN selectivity estimation bound under old compatibility
…n bound under old compatibility
Related: #116137
Related: #114389
#114389 added
statistics_max_set_size_for_exact_selectivity_estimation(default 10000) to bound the cost of estimating the selectivity ofcol IN (...)from column statistics. Its settings changes history entry recorded 0 (no limit) as the previous value, so any user running withcompatibilityset to 26.6 or an earlier version still gets the uncapped estimation, which is exactly the behavior that could add hundreds of milliseconds and gigabytes of allocations to the planning of a single query.This makes the previous value equal to the new one, so the bound applies regardless of
compatibility. An explicitly specified value still wins, as before.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The bound on the cost of estimating the selectivity of
col IN (...)from column statistics, controlled bystatistics_max_set_size_for_exact_selectivity_estimation, is now also applied whencompatibilityis set to 26.6 or an earlier version.Workflow [PR]
Sync PR [sync-upstream/pr/118095]
Version info
26.9.1.863(included in26.9and later)26.8.3.82,26.7.7.69,26.6.5.108