Repository navigation
Conversation
…catalog - ORCA dynamic scans: use get_rel_relkind() since ORCA leaves rte->relkind unset, so full scans were not rejected (issue apache#2342) - planner threshold=0: compare surviving subplans against catalog partition count so statically-pruned partial scans are not rejected (issue apache#2342) - add Test 12/13 regression cases and expected/ baseline (verified on gpdemo) Signed-off-by: liu qiren <13559537330@163.com>
Contributor
Author
|
@tuhaihe this PR addresses both bugs you reported in #2342:
It also adds the previously-missing GPORCA dynamic-scan regression coverage (Test 12/13) and an Verified on a from-source build (
Could a committer approve the workflows / take a look when you have a chance? Thanks! |
Member
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix two bugs in the
reject_partition_fullscangpcontrib extension reported in #2342.Bug 1 — GPORCA full scans not rejected. The dynamic-scan check trusted
rte->relkind, which ORCA leaves unset on the dynamic scan's RTE, so the walkerreturned early and ORCA-planned full partition scans were never rejected. Now the
relkind is looked up from the catalog via
get_rel_relkind().Bug 2 — planner threshold=0 rejects legitimate partial scans. With the
Postgres planner and
partition_fullscan_threshold = 0, an Append produced byplan-time static pruning (a subset of partitions, no
PartitionPruneInfo) wasrejected as if it were a full scan. Now the surviving subplan count is compared
against the catalog partition count (
find_inheritance_children), so only truefull scans are rejected — mirroring the ORCA path's logic.
Changes
reject_partition_fullscan.c: useget_rel_relkind()for the dynamic-scanrelkind check (Bug 1); compare against catalog partition count at threshold 0
in
check_append_no_pruneinfo(Bug 2).sql/partition_fullscan_reject.sql: add Test 12 (planner partial scan must pass,full scan still rejected) and Test 13 (ORCA full scan must be rejected, pruned
query passes) — the GPORCA dynamic-scan coverage that was previously missing.
expected/partition_fullscan_reject.out: add the regression baseline (themodule had no
expected/directory).Verification
Built Apache Cloudberry (main,
--enable-orca --enable-pax) from source in theofficial
cbdb-build-rocky9image on Rocky Linux 9, created a gpdemo cluster, andran
make installcheck:full
count(*)is rejected.count(*)is rejected; pruned query passes.make installcheck→All 1 tests passed.Fixes #2342.