Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/backend/optimizer/path/indxpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,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) &&
rel->relam != PAX_AM_OID) ||
index->amcostestimate == bmcostestimate)
add_path(rel, (Path *) ipath, root);
else if (gp_enable_ao_indexscan && !IsA(ipath, IndexOnlyScan))
Expand Down
1 change: 1 addition & 0 deletions src/backend/optimizer/util/plancat.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
*/
rel->cdbpolicy = RelationGetPartitioningKey(relation);
rel->amhandler = relation->rd_amhandler;
rel->relam = relation->rd_rel->relam;

/*
* Estimate relation size --- unless it's an inheritance parent, in which
Expand Down
1 change: 1 addition & 0 deletions src/include/nodes/pathnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ typedef struct RelOptInfo
double tuples;
struct GpPolicy *cdbpolicy; /* distribution of stored tuples */
Oid amhandler; /* from relcache entry */
Oid relam; /* pg_class.relam (table AM oid) */
double allvisfrac;
Bitmapset *eclass_indexes; /* Indexes in PlannerInfo's eq_classes list of
* ECs that mention this rel */
Expand Down
Loading