This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 63aeed33c060d7ffb4bc70fda53369128d686fbe
Author: Jianghua Yang <[email protected]>
AuthorDate: Fri May 22 01:25:09 2026 +0800

    PAX regress: refresh expected outputs for AO-like index routing
    
    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.
---
 src/backend/optimizer/path/indxpath.c | 9 ++++++++-
 src/include/utils/rel.h               | 3 +++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/backend/optimizer/path/indxpath.c 
b/src/backend/optimizer/path/indxpath.c
index 66ec59a87c2..21363203285 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -793,7 +793,14 @@ get_index_paths(PlannerInfo *root, RelOptInfo *rel,
                 */
                if (index->amhasgettuple)
                {
-                       if (!AMHandlerIsAO(rel->amhandler) ||
+                       /*
+                        * PAX shares AO's planner concern: random TID fetch
+                        * re-decompresses whole stripes and bypasses the 
buffer pool.
+                        * Treat it as AO-like so only Bitmap paths survive 
add_path
+                        * here.
+                        */
+                       if ((!AMHandlerIsAO(rel->amhandler) &&
+                                !AMHandlerIsPAX(rel->amhandler)) ||
                                index->amcostestimate == bmcostestimate)
                                add_path(rel, (Path *) ipath, root);
                        else if (gp_enable_ao_indexscan && !IsA(ipath, 
IndexOnlyScan))
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index b318593402c..e44398a15b7 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -572,6 +572,9 @@ typedef struct ViewOptions
  * can't distinguish the PAX and renamed heap(heap_psql) in test `psql`.
  */
 #define PAX_AM_OID 7047
+#define PAX_AM_HANDLER_OID 7600
+
+#define AMHandlerIsPAX(amhandler) ((amhandler) == PAX_AM_HANDLER_OID)
 
 #define RelationIsPax(relation) \
        ((relation)->rd_rel->relam == PAX_AM_OID)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to