PAX: treat PAX tables as AO-like in index path generation - #1761
Merged
Conversation
Contributor
|
LGTM, please fix the test failures. |
my-ship-it
reviewed
May 25, 2026
my-ship-it
left a comment
Contributor
There was a problem hiding this comment.
I agree with your judgment on the core direction — routing PAX through Bitmap is reasonable.
Some minor suggestion:
- Replace the relam field with reuse of the amhandler path;
- Does PAX also want the gp_enable_ao_indexscan path?
yjhjstz
force-pushed
the
pax/treat-as-ao-for-index-paths
branch
from
May 25, 2026 15:42
32ae28d to
ad5d994
Compare
yjhjstz
force-pushed
the
pax/treat-as-ao-for-index-paths
branch
5 times, most recently
from
May 25, 2026 20:29
24eeb2e to
f1e4054
Compare
yjhjstz
force-pushed
the
pax/treat-as-ao-for-index-paths
branch
from
July 29, 2026 08:27
f1e4054 to
034f9ff
Compare
With PAX relations now treated as AO-like in get_index_paths() (see preceding commit), a btree index over a PAX table no longer produces Index Scan / Index Only Scan plans -- only Bitmap Heap/Index Scan (or Seq Scan) paths survive. Regenerate the affected PAX regression expected outputs to match. Validated by running the PAX regress suite (parallel_schedule + greenplum_schedule) with default_table_access_method=pax; the refreshed files reflect the actual planner output.
yjhjstz
force-pushed
the
pax/treat-as-ao-for-index-paths
branch
from
July 29, 2026 08:35
034f9ff to
496bd3b
Compare
… index routing Refresh the *_optimizer.out expected files to match GPORCA plans under default_table_access_method=pax with optimizer=on, where PAX index paths now surface as Bitmap/Seq scans instead of Index/Index Only Scan. Add index_including_optimizer.out: nametbl is a PAX table, so the Postgres planner (optimizer=off) emits a Bitmap plan (base index_including.out) while GPORCA (optimizer=on) still emits an Index Only Scan over the covering index. The two optimizers diverge, so opt=on needs its own expected file. Refreshed: aggregates, bfv_joins, create_index, incremental_sort, inherit, join, misc_functions, partition_prune, partition_pruning, privileges, rowtypes, select, subselect_gp, union (_optimizer.out).
yjhjstz
force-pushed
the
pax/treat-as-ao-for-index-paths
branch
2 times, most recently
from
July 29, 2026 13:09
08b54ed to
fe113e6
Compare
The nametbl covering-index test only did VACUUM FREEZE with no ANALYZE, so with no column statistics GPORCA used default cardinalities and the plan flipped between Index Only Scan and Index Scan across environments. Add ANALYZE nametbl so the intended Index Only Scan plan is deterministic under both optimizer=off and optimizer=on.
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.
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
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions