-
Notifications
You must be signed in to change notification settings - Fork 200
ORCA: Fix detection of mixed storage in partitioned tables #1524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug in ORCA's storage type detection for partitioned tables that contain a mix of foreign and non-foreign partitions. The issue caused incorrect metadata generation when such mixed storage configurations existed, which could lead to problems with scan type selection and query planning.
Changes:
- Added logic to detect and mark mixed storage when foreign partitions are encountered after non-foreign partitions (or vice versa)
- Converted an independent
ifstatement to anelse ifto create a proper conditional chain for storage type transitions - Improved handling of the initial state when the first partition encountered is foreign
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
leborchuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work, LGTM
my-ship-it
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test cases for bug verification purpose?
450e873 to
3527e35
Compare
Added minidump to verify: grep -o 'StorageType="[^"]*"' src/backend/gporca/data/dxl/minidump/MixedPartitioned-ForeignHeap-Test.mdp/MixedPartitioned-ForeignHeap-Test.mdp |sort|uniq
StorageType="Foreign"
StorageType="Heap"
StorageType="MixedPartitioned" |
src/backend/gporca/data/dxl/minidump/MixedPartitioned-ForeignHeap-Test.mdp
Show resolved
Hide resolved
…gn partitions The storage type detection logic failed to properly identify mixed storage when foreign and non-foreign partitions coexisted, leading to incorrect metadata that could cause issues with scan type selection and query planning.
3527e35 to
7feb1df
Compare
The storage type detection logic failed to properly identify mixed storage when foreign and non-foreign partitions coexisted, leading to incorrect metadata that could cause issues with scan type selection and query planning.
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions