/* *Weuselistsofthisstructtypetokeeptrackofbothoperatorsand *supportfunctionswhilebuildingoraddingtoanopclassoropfamily. *amadjustmembersfunctionsreceivelistsofthesestructs,andareallowed *toaltertheir"ref"fields. * *The"ref"fieldsdefinehowthepg_amoporpg_amprocentryshoulddepend *ontheassociatedobjects(thatis,whichdependencytypetouse,and *whichopclassoropfamilyitshoulddependon). * *Ifref_is_hardistrue,theentrywillhaveaNORMALdependencyonthe *operatororsupportfunc,andanINTERNALdependencyontheopclassor *opfamily.Thisforcestheopclassoropfamilytobedroppedifthe *operatororsupportfuncisdropped,andrequirestheCASCADEoption *todoso.NorwillALTEROPERATORFAMILYDROPbeallowed.Thisis *therightbehaviorforobjectsthatareessentialtoanopclass. * *Ifref_is_hardisfalse,theentrywillhaveanAUTOdependencyonthe *operatororsupportfunc,andalsoanAUTOdependencyontheopclassor *opfamily.ThisallowsALTEROPERATORFAMILYDROP,andcausesthatto *happenautomaticallyiftheoperatororsupportfuncisdropped.This *istherightbehaviorforinessential("loose")objects. * *Wealsomakedependenciesonlefttype/righttype,ofthesamestrengthas *thedependencyontheoperatororsupportfunc,unlessthesedependencies *areredundantwiththedependencyontheoperatororsupportfunc.
*/ typedefstruct OpFamilyMember
{ bool is_func; /* is this an operator, or support func? */
Oid object; /* operator or support func's OID */ int number; /* strategy or support func number */
Oid lefttype; /* lefttype */
Oid righttype; /* righttype */
Oid sortfamily; /* ordering operator's sort opfamily, or 0 */ bool ref_is_hard; /* hard or soft dependency? */ bool ref_is_family; /* is dependency on opclass or opfamily? */
Oid refobjid; /* OID of opclass or opfamily */
} OpFamilyMember;
/* estimate height of a tree-structured index * *XXXThisjustcomputesavaluethatislaterusedbyamcostestimate.This *APIcouldbeexpandedtosupportpassingmorevaluesiftheneedarises.
*/ typedefint (*amgettreeheight_function) (Relation rel);
/* report AM, index, or index column property */ typedefbool (*amproperty_function) (Oid index_oid, int attno,
IndexAMProperty prop, constchar *propname, bool *res, bool *isnull);
/* name of phase as used in progress reporting */ typedefchar *(*ambuildphasename_function) (int64 phasenum);
/* validate definition of an opclass for this AM */ typedefbool (*amvalidate_function) (Oid opclassoid);
/* validate operators and support functions to be added to an opclass/family */ typedefvoid (*amadjustmembers_function) (Oid opfamilyoid,
Oid opclassoid,
List *operators,
List *functions);
/* prepare for index scan */ typedef IndexScanDesc (*ambeginscan_function) (Relation indexRelation, int nkeys, int norderbys);
/* (re)start index scan */ typedefvoid (*amrescan_function) (IndexScanDesc scan,
ScanKey keys, int nkeys,
ScanKey orderbys, int norderbys);
/* *Totalnumberofstrategies(operators)bywhichwecantraverse/search *thisAM.ZeroifAMdoesnothaveafixedsetofstrategyassignments.
*/
uint16 amstrategies; /* total number of support functions that this AM uses */
uint16 amsupport; /* opclass options support function number or 0 */
uint16 amoptsprocnum; /* does AM support ORDER BY indexed column's value? */ bool amcanorder; /* does AM support ORDER BY result of an operator on indexed column? */ bool amcanorderbyop; /* does AM support hashing using API consistent with the hash AM? */ bool amcanhash; /* do operators within an opfamily have consistent equality semantics? */ bool amconsistentequality; /* do operators within an opfamily have consistent ordering semantics? */ bool amconsistentordering; /* does AM support backward scanning? */ bool amcanbackward; /* does AM support UNIQUE indexes? */ bool amcanunique; /* does AM support multi-column indexes? */ bool amcanmulticol; /* does AM require scans to have a constraint on the first index column? */ bool amoptionalkey; /* does AM handle ScalarArrayOpExpr quals? */ bool amsearcharray; /* does AM handle IS NULL/IS NOT NULL quals? */ bool amsearchnulls; /* can index storage data type differ from column data type? */ bool amstorage; /* can an index of this type be clustered on? */ bool amclusterable; /* does AM handle predicate locks? */ bool ampredlocks; /* does AM support parallel scan? */ bool amcanparallel; /* does AM support parallel build? */ bool amcanbuildparallel; /* does AM support columns included with clause INCLUDE? */ bool amcaninclude; /* does AM use maintenance_work_mem? */ bool amusemaintenanceworkmem; /* does AM store tuple information only at block granularity? */ bool amsummarizing; /* OR of parallel vacuum flags. See vacuum.h for flags. */
uint8 amparallelvacuumoptions; /* type of data stored in index, or InvalidOid if variable */
Oid amkeytype;
/* interface functions */
ambuild_function ambuild;
ambuildempty_function ambuildempty;
aminsert_function aminsert;
aminsertcleanup_function aminsertcleanup; /* can be NULL */
ambulkdelete_function ambulkdelete;
amvacuumcleanup_function amvacuumcleanup;
amcanreturn_function amcanreturn; /* can be NULL */
amcostestimate_function amcostestimate;
amgettreeheight_function amgettreeheight; /* can be NULL */
amoptions_function amoptions;
amproperty_function amproperty; /* can be NULL */
ambuildphasename_function ambuildphasename; /* can be NULL */
amvalidate_function amvalidate;
amadjustmembers_function amadjustmembers; /* can be NULL */
ambeginscan_function ambeginscan;
amrescan_function amrescan;
amgettuple_function amgettuple; /* can be NULL */
amgetbitmap_function amgetbitmap; /* can be NULL */
amendscan_function amendscan;
ammarkpos_function ammarkpos; /* can be NULL */
amrestrpos_function amrestrpos; /* can be NULL */
/* interface functions to support parallel index scans */
amestimateparallelscan_function amestimateparallelscan; /* can be NULL */
aminitparallelscan_function aminitparallelscan; /* can be NULL */
amparallelrescan_function amparallelrescan; /* can be NULL */
/* interface functions to support planning */
amtranslate_strategy_function amtranslatestrategy; /* can be NULL */
amtranslate_cmptype_function amtranslatecmptype; /* can be NULL */
} IndexAmRoutine;
/* Functions in access/index/amapi.c */ extern IndexAmRoutine *GetIndexAmRoutine(Oid amhandler); extern IndexAmRoutine *GetIndexAmRoutineByAmId(Oid amoid, bool noerror); extern CompareType IndexAmTranslateStrategy(StrategyNumber strategy, Oid amoid, Oid opfamily, bool missing_ok); extern StrategyNumber IndexAmTranslateCompareType(CompareType cmptype, Oid amoid, Oid opfamily, bool missing_ok);
#endif/* AMAPI_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.