Skip to content

PAX: treat PAX tables as AO-like in index path generation#1761

Open
yjhjstz wants to merge 1 commit into
apache:mainfrom
yjhjstz:pax/treat-as-ao-for-index-paths
Open

PAX: treat PAX tables as AO-like in index path generation#1761
yjhjstz wants to merge 1 commit into
apache:mainfrom
yjhjstz:pax/treat-as-ao-for-index-paths

Conversation

@yjhjstz
Copy link
Copy Markdown
Member

@yjhjstz yjhjstz commented May 21, 2026

Random TID fetches on PAX tables re-decompress entire stripes (1.5 MB ZSTD blocks) per tuple and bypass the buffer pool, just like AO/AOCS. get_index_paths() already routes AO/AOCS relations to Bitmap paths only and skips IndexScan/IndexOnlyScan (the latter is unimplemented for AO). Extend the same treatment to PAX so that a btree index over a PAX table no longer triggers full-table Index Only Scan when enable_seqscan=off, which previously caused customer queries to hang indefinitely.

Detection uses the existing PAX_AM_OID; RelOptInfo gains a relam field cached from rd_rel->relam (mirroring amhandler) so the planner can do the comparison without opening the relation.

Heap tables and existing AO behavior are unaffected.

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


Random TID fetches on PAX tables re-decompress entire stripes (1.5 MB
ZSTD blocks) per tuple and bypass the buffer pool, just like AO/AOCS.
get_index_paths() already routes AO/AOCS relations to Bitmap paths only
and skips IndexScan/IndexOnlyScan (the latter is unimplemented for AO).
Extend the same treatment to PAX so that a btree index over a PAX table
no longer triggers full-table Index Only Scan when enable_seqscan=off,
which previously caused customer queries to hang indefinitely.

Detection uses the existing PAX_AM_OID; RelOptInfo gains a relam field
cached from rd_rel->relam (mirroring amhandler) so the planner can do
the comparison without opening the relation.

Heap tables and existing AO behavior are unaffected.
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