Skip to content

Conversation

@yjhjstz
Copy link
Member

@yjhjstz yjhjstz commented Jan 11, 2026

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

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


…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.
Copilot AI review requested due to automatic review settings January 11, 2026 15:39
Copy link

Copilot AI left a 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 if statement to an else if to 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.

Copy link
Contributor

@leborchuk leborchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should work, LGTM

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