PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | PartitionBoundInfoData |
Macros | |
#define | partition_bound_accepts_nulls(bi) ((bi)->null_index != -1) |
#define | partition_bound_has_default(bi) ((bi)->default_index != -1) |
Typedefs | |
typedef struct PartitionBoundInfoData | PartitionBoundInfoData |
#define partition_bound_accepts_nulls | ( | bi | ) | ((bi)->null_index != -1) |
Definition at line 98 of file partbounds.h.
#define partition_bound_has_default | ( | bi | ) | ((bi)->default_index != -1) |
Definition at line 99 of file partbounds.h.
typedef struct PartitionBoundInfoData PartitionBoundInfoData |
void check_default_partition_contents | ( | Relation | parent, |
Relation | default_rel, | ||
PartitionBoundSpec * | new_spec | ||
) |
Definition at line 3251 of file partbounds.c.
References AccessExclusiveLock, CHECK_FOR_INTERRUPTS, CreateExecutorState(), DEBUG1, ExprContext::ecxt_scantuple, ereport, errcode(), errmsg(), errmsg_internal(), ERROR, errtable(), EState::es_tupleTable, ExecCheck(), ExecDropSingleTupleTableSlot(), ExecPrepareExpr(), find_all_inheritors(), ForwardScanDirection, FreeExecutorState(), get_proposed_default_constraint(), get_qual_for_list(), get_qual_for_range(), GetLatestSnapshot(), GetPerTupleExprContext, GetPerTupleMemoryContext, lfirst_oid, list_make1_oid, make_ands_explicit(), map_partition_varattnos(), MemoryContextSwitchTo(), NoLock, PartConstraintImpliedByRelConstraint(), PARTITION_STRATEGY_LIST, RelationData::rd_rel, RegisterSnapshot(), RelationGetRelationName, RelationGetRelid, ResetExprContext, PartitionBoundSpec::strategy, table_beginscan(), table_close(), table_endscan(), table_open(), table_scan_getnextslot(), table_slot_create(), UnregisterSnapshot(), and WARNING.
Referenced by DefineRelation().
void check_new_partition_bound | ( | char * | relname, |
Relation | parent, | ||
PartitionBoundSpec * | spec, | ||
ParseState * | pstate | ||
) |
Definition at line 2896 of file partbounds.c.
References Assert, PartitionDescData::boundinfo, DatumGetInt32(), PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, equal(), ereport, errcode(), errdetail(), errmsg(), ERROR, get_range_partbound_string(), get_rel_name(), PartitionBoundInfoData::indexes, PartitionBoundSpec::is_default, sort-test::key, PartitionBoundInfoData::kind, lfirst_node, linitial, list_nth(), PartitionBoundSpec::listdatums, PartitionBoundSpec::location, PartitionRangeDatum::location, lower(), PartitionBoundSpec::lowerdatums, make_one_partition_rbound(), PartitionBoundSpec::modulus, PartitionBoundInfoData::ndatums, PartitionBoundInfoData::nindexes, PartitionDescData::nparts, PartitionBoundInfoData::null_index, PartitionDescData::oids, parser_errposition(), partition_bound_accepts_nulls, partition_bound_has_default, partition_hash_bsearch(), partition_list_bsearch(), partition_range_bsearch(), partition_rbound_cmp(), PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, RelationGetPartitionDesc(), RelationGetPartitionKey(), relname, PartitionBoundSpec::remainder, PartitionBoundSpec::strategy, PartitionBoundInfoData::strategy, upper(), PartitionBoundSpec::upperdatums, and val.
Referenced by ATExecAttachPartition(), and DefineRelation().
uint64 compute_partition_hash_value | ( | int | partnatts, |
FmgrInfo * | partsupfunc, | ||
const Oid * | partcollation, | ||
const Datum * | values, | ||
const bool * | isnull | ||
) |
Definition at line 4722 of file partbounds.c.
References Assert, DatumGetUInt64(), FunctionCall2Coll(), hash(), hash_combine64(), HASH_PARTITION_SEED, i, OidIsValid, UInt64GetDatum(), and values.
Referenced by get_matching_hash_bounds(), and get_partition_for_tuple().
int get_hash_partition_greatest_modulus | ( | PartitionBoundInfo | bound | ) |
Definition at line 3414 of file partbounds.c.
References Assert, PartitionBoundInfoData::nindexes, PARTITION_STRATEGY_HASH, and PartitionBoundInfoData::strategy.
List* get_qual_from_partbound | ( | Relation | parent, |
PartitionBoundSpec * | spec | ||
) |
Definition at line 249 of file partbounds.c.
References Assert, get_qual_for_hash(), get_qual_for_list(), get_qual_for_range(), sort-test::key, NIL, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, RelationGetPartitionKey(), and PartitionBoundSpec::strategy.
Referenced by ATExecAttachPartition(), and generate_partition_qual().
PartitionBoundInfo partition_bounds_copy | ( | PartitionBoundInfo | src, |
PartitionKey | key | ||
) |
Definition at line 1002 of file partbounds.c.
References Assert, bms_copy(), datumCopy(), PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, generate_unaccent_rules::dest, i, PartitionBoundInfoData::indexes, PartitionBoundInfoData::interleaved_parts, j, sort-test::key, PartitionBoundInfoData::kind, PartitionBoundInfoData::ndatums, PartitionBoundInfoData::nindexes, PartitionBoundInfoData::null_index, palloc(), PARTITION_RANGE_DATUM_VALUE, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, and PartitionBoundInfoData::strategy.
Referenced by RelationBuildPartitionDesc().
PartitionBoundInfo partition_bounds_create | ( | PartitionBoundSpec ** | boundspecs, |
int | nparts, | ||
PartitionKey | key, | ||
int ** | mapping | ||
) |
Definition at line 299 of file partbounds.c.
References Assert, create_hash_bounds(), create_list_bounds(), create_range_bounds(), i, sort-test::key, palloc(), PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, and PARTITION_STRATEGY_RANGE.
Referenced by RelationBuildPartitionDesc().
bool partition_bounds_equal | ( | int | partnatts, |
int16 * | parttyplen, | ||
bool * | parttypbyval, | ||
PartitionBoundInfo | b1, | ||
PartitionBoundInfo | b2 | ||
) |
Definition at line 896 of file partbounds.c.
References Assert, datumIsEqual(), PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, i, PartitionBoundInfoData::indexes, j, PartitionBoundInfoData::kind, PartitionBoundInfoData::ndatums, PartitionBoundInfoData::nindexes, PartitionBoundInfoData::null_index, PARTITION_RANGE_DATUM_VALUE, PARTITION_STRATEGY_HASH, and PartitionBoundInfoData::strategy.
Referenced by compute_partition_bounds().
PartitionBoundInfo partition_bounds_merge | ( | int | partnatts, |
FmgrInfo * | partsupfunc, | ||
Oid * | partcollation, | ||
struct RelOptInfo * | outer_rel, | ||
struct RelOptInfo * | inner_rel, | ||
JoinType | jointype, | ||
List ** | outer_parts, | ||
List ** | inner_parts | ||
) |
Definition at line 1118 of file partbounds.c.
References Assert, JOIN_ANTI, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_SEMI, merge_list_bounds(), merge_range_bounds(), NIL, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, and PARTITION_STRATEGY_RANGE.
Referenced by compute_partition_bounds().
int partition_hash_bsearch | ( | PartitionBoundInfo | boundinfo, |
int | modulus, | ||
int | remainder | ||
) |
Definition at line 3738 of file partbounds.c.
References DatumGetInt32(), PartitionBoundInfoData::datums, PartitionBoundInfoData::ndatums, and partition_hbound_cmp().
Referenced by check_new_partition_bound().
int partition_list_bsearch | ( | FmgrInfo * | partsupfunc, |
Oid * | partcollation, | ||
PartitionBoundInfo | boundinfo, | ||
Datum | value, | ||
bool * | is_equal | ||
) |
Definition at line 3607 of file partbounds.c.
References DatumGetInt32(), PartitionBoundInfoData::datums, FunctionCall2Coll(), PartitionBoundInfoData::ndatums, and value.
Referenced by check_new_partition_bound(), get_matching_list_bounds(), and get_partition_for_tuple().
int partition_range_datum_bsearch | ( | FmgrInfo * | partsupfunc, |
Oid * | partcollation, | ||
PartitionBoundInfo | boundinfo, | ||
int | nvalues, | ||
Datum * | values, | ||
bool * | is_equal | ||
) |
Definition at line 3695 of file partbounds.c.
References PartitionBoundInfoData::datums, PartitionBoundInfoData::kind, PartitionBoundInfoData::ndatums, partition_rbound_datum_cmp(), and values.
Referenced by get_matching_range_bounds(), and get_partition_for_tuple().
int32 partition_rbound_datum_cmp | ( | FmgrInfo * | partsupfunc, |
Oid * | partcollation, | ||
Datum * | rb_datums, | ||
PartitionRangeDatumKind * | rb_kind, | ||
Datum * | tuple_datums, | ||
int | n_tuple_datums | ||
) |
Definition at line 3556 of file partbounds.c.
References DatumGetInt32(), FunctionCall2Coll(), i, PARTITION_RANGE_DATUM_MAXVALUE, and PARTITION_RANGE_DATUM_MINVALUE.
Referenced by get_matching_range_bounds(), get_partition_for_tuple(), and partition_range_datum_bsearch().
bool partitions_are_ordered | ( | PartitionBoundInfo | boundinfo, |
Bitmapset * | live_parts | ||
) |
Definition at line 2852 of file partbounds.c.
References Assert, bms_is_member(), bms_overlap(), PartitionBoundInfoData::default_index, PartitionBoundInfoData::interleaved_parts, partition_bound_has_default, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, and PartitionBoundInfoData::strategy.
Referenced by build_partition_pathkeys(), and generate_orderedappend_paths().