struct RelOptInfo; /* avoid including pathnodes.h here */
/* *PartitionBoundInfoDataencapsulatesasetofpartitionbounds.Itis *usuallyassociatedwithpartitionedtablesaspartofitspartition *descriptor,butmayalsobeusedtorepresentavirtualpartitioned *tablesuchasapartitionedjoinrelwithintheplanner. * *AlistpartitiondatumthatisknowntobeNULLisneverputintothe *datumsarray.Instead,itistrackedusingthenull_indexfield. * *Inthecaseofrangepartitioning,ndatumswilltypicallybefarlessthan *2*nparts,becauseapartition'supperboundandthenextpartition'slower *boundarethesameinmostcommoncases,andweonlystoreoneofthem(the *upperbound).Incaseofhashpartitioning,ndatumswillbethesameasthe *numberofpartitions. * *Forrangeandlistpartitionedtables,datumsisanarrayofdatum-tuples *withkey->partnattsdatumseach.Forhashpartitionedtables,itisanarray *ofdatum-tupleswith2datums,modulusandremainder,correspondingtoa *givenpartition. * *Thedatumsindatumsarrayarearrangedinincreasingorderasdefinedby *functionsqsort_partition_rbound_cmp(),qsort_partition_list_value_cmp()and *qsort_partition_hbound_cmp()forrange,listandhashpartitionedtables *respectively.Forrangeandlistpartitionsthissimplymeansthatthe *datumsinthedatumsarrayarearrangedinincreasingorderasdefinedby *thepartitionkey'soperatorclassesandcollations. * *Inthecaseoflistpartitioning,theindexesarraystoresoneentryfor *eachdatum-arrayentry,whichistheindexofthepartitionthataccepts *rowsmatchingthatdatum.Sonindexes==ndatums. * *Inthecaseofrangepartitioning,theindexesarraystoresoneentryper *distinctrangedatum,whichistheindexofthepartitionforwhichthat *datumisanupperbound(or-1fora"gap"thathasnopartition).Itis *convenienttohaveanextra-1entryrepresentingvaluesabovethelast *rangedatum,sonindexes==ndatums+1. * *Inthecaseofhashpartitioning,thenumberofentriesintheindexes *arrayisthesameasthegreatestmodulusamongstallpartitions(which *isamultipleofallpartitionmoduli),sonindexes==greatestmodulus. *Theindexesarrayisindexedaccordingtothehashkey'sremaindermodulo *thegreatestmodulus,anditcontainseitherthepartitionindexaccepting *thatremainder,or-1ifthereisnopartitionforthatremainder. * *ForLISTpartitionedtables,wetrackthepartitionindexesofpartitions *whicharepossibly"interleaved"partitions.Apartitionisconsidered *interleavedifitallowsmultiplevaluesandthereexistsatleastone *otherpartitionwhichcouldcontainavaluethatliesbetweenthosevalues. *Forexample,ifapartitionexistsFORVALUESIN(3,5)andanotherpartition *existsFORVALUESIN(4),thentheIN(3,5)partitionisaninterleaved *partition.ThesameispossiblewithDEFAULTpartitionssincetheycan *containanyvaluethatdoesnotbelonginanotherpartition.Thisfield *onlyservesasproofthataparticularpartitionisnotinterleaved,not *proofthatitisinterleaved.Whenwe'reuncertain,wemarkedthe *partitionasinterleaved.Theinterleaved_partsfieldisonlyeversetfor *RELOPT_BASERELandRELOPT_OTHER_MEMBER_REL,itisalwaysleftNULLforjoin *relations.
*/ typedefstruct PartitionBoundInfoData
{
PartitionStrategy strategy; /* hash, list or range? */ int ndatums; /* Length of the datums[] array */
Datum **datums;
PartitionRangeDatumKind **kind; /* The kind of each range bound datum; *NULLforhashandlistpartitioned
* tables */
Bitmapset *interleaved_parts; /* Partition indexes of partitions which *maybeinterleaved.Seeabove.Thisis
* only set for LIST partitioned tables */ int nindexes; /* Length of the indexes[] array */ int *indexes; /* Partition indexes */ int null_index; /* Index of the null-accepting partition; -1
* if there isn't one */ int default_index; /* Index of the default partition; -1 if there
* isn't one */
} PartitionBoundInfoData;
extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc,
Oid *partcollation,
Datum *rb_datums, PartitionRangeDatumKind *rb_kind,
Datum *tuple_datums, int n_tuple_datums); externint partition_list_bsearch(FmgrInfo *partsupfunc,
Oid *partcollation,
PartitionBoundInfo boundinfo,
Datum value, bool *is_equal); externint partition_range_datum_bsearch(FmgrInfo *partsupfunc,
Oid *partcollation,
PartitionBoundInfo boundinfo, int nvalues, Datum *values, bool *is_equal); externint partition_hash_bsearch(PartitionBoundInfo boundinfo, int modulus, int remainder);
#endif/* PARTBOUNDS_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-08-06)
¤
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.