Skip to content

ORCA: allow partition table use the append node #1022

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jiaqizho
Copy link
Contributor

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


@jiaqizho
Copy link
Contributor Author

Run CI with optimizer_disable_dynamic_table_scan turned on to ensure there are no other issues.

After that, i will added the test and set optimizer_disable_dynamic_table_scan default false.

@my-ship-it my-ship-it requested a review from gfphoenix78 March 31, 2025 06:08
@jiaqizho jiaqizho force-pushed the add-append-back branch 4 times, most recently from 716e7f8 to ca8ea07 Compare April 7, 2025 06:12
@jiaqizho jiaqizho changed the title [DNM]ORCA: allow partition table use the append node ORCA: allow partition table use the append node Apr 7, 2025
In ORCA, both Dynamic Scan and Append operators can serve as scan methods
for partitioned tables.

Historically, ORCA initially supported the Append operator before switching
to Dynamic Any Scan, with several iterations of changes in between.

In current CBDB versions, Dynamic Scan is the default partitioned table scan
operator. However, the vectorized executor in CBDB (closed-source) cannot
support Dynamic Scan due to its multi-threaded architecture, which prohibits
metadata reading during scanning.

This commit reintroduces the Append operator as an alternative. The GUC
`optimizer_disable_dynamic_table_scan` (default: off) now allows choosing
between Dynamic Scan and Append operators.

Important considerations when using Append operator:

1. **Row-level security unsupported on root partition table**: Append cannot
be used with row-level security on partitioned tables. ORCA applies row-level
security at the final stage, making it impossible to determine the root partition
after generating Append plans. Dynamic Scan preserves root partition information,
enabling runtime application of row-level security to child partitions.

2. **No index-only scan support**: This is a CBDB executor limitation. Only
Dynamic Scan supports index-only scans for partitioned tables.
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.

1 participant