mirror of
https://github.com/postgres/postgres.git
synced 2025-07-17 06:41:09 +03:00
Replace simple constant pg_am.amcanreturn with an AM support function.
The need for this was debated when we put in the index-only-scan feature, but at the time we had no near-term expectation of having AMs that could support such scans for only some indexes; so we kept it simple. However, the SP-GiST AM forces the issue, so let's fix it. This patch only installs the new API; no behavior actually changes.
This commit is contained in:
@ -1075,10 +1075,10 @@ check_index_only(RelOptInfo *rel, IndexOptInfo *index)
|
||||
ListCell *lc;
|
||||
int i;
|
||||
|
||||
/* Index-only scans must be enabled, and AM must be capable of it */
|
||||
/* Index-only scans must be enabled, and index must be capable of them */
|
||||
if (!enable_indexonlyscan)
|
||||
return false;
|
||||
if (!index->amcanreturn)
|
||||
if (!index->canreturn)
|
||||
return false;
|
||||
|
||||
/*
|
||||
|
@ -212,8 +212,8 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent,
|
||||
|
||||
info->relam = indexRelation->rd_rel->relam;
|
||||
info->amcostestimate = indexRelation->rd_am->amcostestimate;
|
||||
info->canreturn = index_can_return(indexRelation);
|
||||
info->amcanorderbyop = indexRelation->rd_am->amcanorderbyop;
|
||||
info->amcanreturn = indexRelation->rd_am->amcanreturn;
|
||||
info->amoptionalkey = indexRelation->rd_am->amoptionalkey;
|
||||
info->amsearcharray = indexRelation->rd_am->amsearcharray;
|
||||
info->amsearchnulls = indexRelation->rd_am->amsearchnulls;
|
||||
|
Reference in New Issue
Block a user