|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/relation.h"#include "access/table.h"#include "access/tableam.h"#include "catalog/namespace.h"#include "catalog/partition.h"#include "catalog/pg_inherits.h"#include "catalog/pg_type.h"#include "commands/tablecmds.h"#include "common/hashfn.h"#include "executor/executor.h"#include "miscadmin.h"#include "nodes/makefuncs.h"#include "nodes/nodeFuncs.h"#include "nodes/pathnodes.h"#include "parser/parse_coerce.h"#include "partitioning/partbounds.h"#include "partitioning/partdesc.h"#include "utils/array.h"#include "utils/builtins.h"#include "utils/datum.h"#include "utils/fmgroids.h"#include "utils/lsyscache.h"#include "utils/partcache.h"#include "utils/ruleutils.h"#include "utils/snapmgr.h"#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
| struct | PartitionHashBound |
| struct | PartitionListValue |
| struct | PartitionRangeBound |
| struct | PartitionMap |
Macros | |
| #define | compare_range_bounds(partnatts, partsupfunc, partcollations, bound1, bound2) |
| #define compare_range_bounds | ( | partnatts, | |
| partsupfunc, | |||
| partcollations, | |||
| bound1, | |||
| bound2 | |||
| ) |
Definition at line 89 of file partbounds.c.
|
static |
Definition at line 2768 of file partbounds.c.
References Assert, fb(), lappend(), lappend_int(), llast, llast_int, and partition_rbound_cmp().
Referenced by merge_range_bounds().
|
static |
Definition at line 2512 of file partbounds.c.
References Assert, fb(), lappend_int(), lfirst, lfirst_int, list_length(), NIL, palloc_array, palloc_object, PARTITION_STRATEGY_LIST, and PARTITION_STRATEGY_RANGE.
Referenced by merge_list_bounds(), and merge_range_bounds().
| void calculate_partition_bound_for_merge | ( | Relation | parent, |
| List * | partNames, | ||
| List * | partOids, | ||
| PartitionBoundSpec * | spec, | ||
| ParseState * | pstate | ||
| ) |
Definition at line 5098 of file partbounds.c.
References Assert, check_two_partitions_bounds_range(), elog, ERROR, fb(), foreach_current_index, foreach_oid, get_partition_bound_spec(), i, lappend(), list_concat(), list_free(), list_length(), list_nth(), PartitionBoundSpec::listdatums, PartitionBoundSpec::lowerdatums, make_one_partition_rbound(), NIL, palloc0_array, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, pfree(), qsort_arg(), qsort_partition_rbound_cmp(), and RelationGetPartitionKey().
Referenced by transformPartitionCmdForMerge().
| void check_default_partition_contents | ( | Relation | parent, |
| Relation | default_rel, | ||
| PartitionBoundSpec * | new_spec | ||
| ) |
Definition at line 3244 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(), fb(), 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, RegisterSnapshot(), RelationGetRelationName, RelationGetRelid, ResetExprContext, 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 2889 of file partbounds.c.
References Assert, PartitionDescData::boundinfo, DatumGetInt32(), PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, equal(), ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), get_range_partbound_string(), get_rel_name(), PartitionBoundInfoData::indexes, PartitionBoundInfoData::kind, lfirst_node, linitial, list_nth(), PartitionRangeDatum::location, lower(), make_one_partition_rbound(), 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, remainder, PartitionBoundInfoData::strategy, upper(), and val.
Referenced by ATExecAttachPartition(), check_partitions_for_split(), and DefineRelation().
|
static |
Definition at line 5622 of file partbounds.c.
References Assert, PartitionDescData::boundinfo, PartitionBoundInfoData::datums, deparse_expression(), ereport, errcode(), errhint(), errmsg(), ERROR, fb(), find_value_in_new_partitions_list(), get_rel_name(), i, PartitionBoundInfoData::indexes, makeConst(), PartitionBoundInfoData::ndatums, NIL, PartitionBoundInfoData::null_index, PartitionDescData::oids, partition_bound_accepts_nulls, PARTITION_STRATEGY_LIST, PointerGetDatum(), RelationGetPartitionDesc(), and RelationGetPartitionKey().
Referenced by check_partitions_for_split().
|
static |
Definition at line 5481 of file partbounds.c.
References Assert, PartitionDescData::boundinfo, equal(), ereport, errcode(), errmsg(), ERROR, exprLocation(), fb(), foreach_node, get_rel_name(), PartitionBoundInfoData::indexes, PartitionBoundInfoData::null_index, PartitionDescData::oids, parser_errposition(), partition_bound_accepts_nulls, partition_list_bsearch(), PARTITION_STRATEGY_LIST, RelationGetPartitionDesc(), RelationGetPartitionKey(), relname, PartitionBoundInfoData::strategy, and val.
Referenced by check_partitions_for_split().
|
static |
Definition at line 5324 of file partbounds.c.
References Assert, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, exprLocation(), fb(), get_partition_bound_spec(), get_range_partbound_string(), get_rel_name(), list_nth(), lower(), make_one_partition_rbound(), parser_errposition(), partition_rbound_cmp(), PARTITION_STRATEGY_RANGE, RelationGetPartitionKey(), relname, and upper().
Referenced by check_partitions_for_split().
| void check_partitions_for_split | ( | Relation | parent, |
| Oid | splitPartOid, | ||
| List * | partlist, | ||
| ParseState * | pstate | ||
| ) |
Definition at line 5723 of file partbounds.c.
References Assert, check_new_partition_bound(), check_parent_values_in_new_partitions(), check_partition_bounds_for_split_list(), check_partition_bounds_for_split_range(), check_partitions_not_overlap_list(), check_two_partitions_bounds_range(), fb(), foreach_current_index, foreach_node, get_default_oid_from_partdesc(), get_partition_strategy(), i, list_length(), make_one_partition_rbound(), palloc0_array, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, pfree(), qsort_arg(), qsort_partition_rbound_cmp(), RelationGetPartitionDesc(), and RelationGetPartitionKey().
Referenced by transformPartitionCmdForSplit().
|
static |
Definition at line 5258 of file partbounds.c.
References Assert, ereport, errcode(), errmsg(), ERROR, exprLocation(), fb(), i, j, linitial_node, list_length(), parser_errposition(), PARTITION_STRATEGY_LIST, partitions_listdatum_intersection(), PG_USED_FOR_ASSERTS_ONLY, RelationGetPartitionKey(), and val.
Referenced by check_partitions_for_split().
|
static |
Definition at line 4997 of file partbounds.c.
References Assert, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, fb(), linitial, PartitionRangeDatum::location, make_one_partition_rbound(), parser_errposition(), partition_rbound_cmp(), PARTITION_STRATEGY_RANGE, and RelationGetPartitionKey().
Referenced by calculate_partition_bound_for_merge(), and check_partitions_for_split().
|
static |
Definition at line 2655 of file partbounds.c.
References compare_range_bounds, and fb().
Referenced by merge_range_bounds().
| uint64 compute_partition_hash_value | ( | int | partnatts, |
| FmgrInfo * | partsupfunc, | ||
| const Oid * | partcollation, | ||
| const Datum * | values, | ||
| const bool * | isnull | ||
| ) |
Definition at line 4714 of file partbounds.c.
References Assert, DatumGetUInt64(), fb(), FunctionCall2Coll(), hash(), hash_combine64(), HASH_PARTITION_SEED, i, OidIsValid, UInt64GetDatum(), and values.
Referenced by get_matching_hash_bounds(), and get_partition_for_tuple().
|
static |
Definition at line 348 of file partbounds.c.
References Assert, PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, elog, ERROR, fb(), i, PartitionBoundInfoData::indexes, Int32GetDatum(), PartitionBoundInfoData::interleaved_parts, PartitionBoundInfoData::kind, PartitionBoundInfoData::ndatums, PartitionBoundInfoData::nindexes, PartitionBoundInfoData::null_index, palloc(), palloc0_array, palloc0_object, palloc_array, PARTITION_STRATEGY_HASH, pfree(), qsort, qsort_partition_hbound_cmp(), remainder, and PartitionBoundInfoData::strategy.
Referenced by partition_bounds_create().
|
static |
Definition at line 461 of file partbounds.c.
References Assert, bms_add_member(), datumCopy(), PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, elog, ERROR, fb(), get_non_null_list_datum_count(), i, PartitionBoundInfoData::indexes, PartitionBoundInfoData::interleaved_parts, j, PartitionBoundInfoData::kind, lfirst_node, PartitionBoundInfoData::ndatums, PartitionBoundInfoData::nindexes, PartitionBoundInfoData::null_index, palloc(), palloc0_array, palloc0_object, partition_bound_accepts_nulls, partition_bound_has_default, PARTITION_STRATEGY_LIST, pfree(), qsort_arg(), qsort_partition_list_value_cmp(), PartitionBoundInfoData::strategy, val, and value.
Referenced by partition_bounds_create().
|
static |
Definition at line 675 of file partbounds.c.
References Assert, cur, datumCopy(), DatumGetInt32(), PartitionRangeBound::datums, PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, elog, ERROR, fb(), FunctionCall2Coll(), i, PartitionBoundInfoData::indexes, PartitionBoundInfoData::interleaved_parts, j, PartitionRangeBound::kind, PartitionBoundInfoData::kind, lower(), make_one_partition_rbound(), PartitionBoundInfoData::ndatums, PartitionBoundInfoData::nindexes, PartitionBoundInfoData::null_index, palloc(), palloc0_array, palloc0_object, palloc_array, PARTITION_RANGE_DATUM_VALUE, PARTITION_STRATEGY_RANGE, pfree(), qsort_arg(), qsort_partition_rbound_cmp(), PartitionBoundInfoData::strategy, and upper().
Referenced by partition_bounds_create().
|
static |
Definition at line 5578 of file partbounds.c.
References DatumGetInt32(), fb(), foreach_node, FunctionCall2Coll(), i, val, and value.
Referenced by check_parent_values_in_new_partitions().
|
static |
Definition at line 2379 of file partbounds.c.
References Assert, fb(), i, lfirst_int, palloc_array, and pfree().
Referenced by merge_list_bounds().
|
static |
Definition at line 1826 of file partbounds.c.
References PartitionMap::merged, PartitionMap::merged_indexes, PartitionMap::old_indexes, and pfree().
Referenced by merge_list_bounds(), and merge_range_bounds().
|
static |
Definition at line 2433 of file partbounds.c.
References Assert, fb(), i, lappend(), Max, NIL, palloc_array, and pfree().
Referenced by merge_list_bounds(), and merge_range_bounds().
| int get_hash_partition_greatest_modulus | ( | PartitionBoundInfo | bound | ) |
Definition at line 3407 of file partbounds.c.
References Assert, PartitionBoundInfoData::nindexes, PARTITION_STRATEGY_HASH, and PartitionBoundInfoData::strategy.
|
static |
Definition at line 2704 of file partbounds.c.
References Assert, compare_range_bounds, elog, ERROR, fb(), JOIN_ANTI, JOIN_FULL, JOIN_INNER, JOIN_LEFT, and JOIN_SEMI.
Referenced by merge_range_bounds().
|
static |
Definition at line 435 of file partbounds.c.
References fb(), i, lfirst_node, and val.
Referenced by create_list_bounds().
|
static |
Definition at line 5056 of file partbounds.c.
References elog, ERROR, fb(), HeapTupleIsValid, IsA, ReleaseSysCache(), SearchSysCache1(), stringToNode(), SysCacheGetAttr(), and TextDatumGetCString.
Referenced by calculate_partition_bound_for_merge(), and check_partition_bounds_for_split_range().
|
static |
Definition at line 3824 of file partbounds.c.
References elog, ERROR, fb(), get_opfamily_member(), and OidIsValid.
Referenced by make_partition_op_expr().
|
static |
Definition at line 3975 of file partbounds.c.
References COERCE_EXPLICIT_CALL, copyObject, fb(), i, Int32GetDatum(), InvalidOid, lappend(), lfirst, list_head(), list_make1, list_make3, lnext(), makeConst(), makeFuncExpr(), makeVar(), ObjectIdGetDatum(), RelationGetPartitionKey(), and RelationGetRelid.
Referenced by get_qual_from_partbound().
|
static |
Definition at line 4058 of file partbounds.c.
References Assert, BTEqualStrategyNumber, copyObject, datumCopy(), PartitionBoundInfoData::datums, fb(), i, IS_NOT_NULL, IS_NULL, lappend(), lfirst_node, linitial, list_make1, list_make2, make_ands_explicit(), make_partition_op_expr(), makeBoolExpr(), makeConst(), makeNode, makeVar(), PartitionBoundInfoData::ndatums, NIL, NOT_EXPR, OR_EXPR, partition_bound_accepts_nulls, RelationGetPartitionDesc(), RelationGetPartitionKey(), and val.
Referenced by check_default_partition_contents(), and get_qual_from_partbound().
|
static |
Definition at line 4267 of file partbounds.c.
References AND_EXPR, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, castNode, CreateExecutorState(), DatumGetBool(), elog, ERROR, EState::es_query_cxt, ExecEvalExprSwitchContext(), ExecInitExpr(), fb(), fix_opfuncids(), for_both_cell, forboth, FreeExecutorState(), get_qual_for_range(), get_range_key_properties(), get_range_nulltest(), GetPerTupleExprContext, HeapTupleIsValid, i, IsA, j, lappend(), lfirst, lfirst_node, linitial, list_head(), list_length(), list_make1, lnext(), make_partition_op_expr(), makeBoolConst(), makeBoolExpr(), MemoryContextSwitchTo(), NIL, NOT_EXPR, ObjectIdGetDatum(), OR_EXPR, PARTITION_RANGE_DATUM_MAXVALUE, PARTITION_RANGE_DATUM_MINVALUE, PARTITION_RANGE_DATUM_VALUE, RelationGetPartitionDesc(), RelationGetPartitionKey(), ReleaseSysCache(), SearchSysCache1(), stringToNode(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Referenced by check_default_partition_contents(), get_qual_for_range(), and get_qual_from_partbound().
| List * get_qual_from_partbound | ( | Relation | parent, |
| PartitionBoundSpec * | spec | ||
| ) |
Definition at line 250 of file partbounds.c.
References Assert, fb(), get_qual_for_hash(), get_qual_for_list(), get_qual_for_range(), NIL, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, and RelationGetPartitionKey().
Referenced by ATExecAttachPartition(), generate_partition_qual(), and SplitPartitionMoveRows().
|
static |
Definition at line 4624 of file partbounds.c.
References castNode, copyObject, elog, ERROR, fb(), PartitionRangeDatum::kind, lfirst, lnext(), makeVar(), PARTITION_RANGE_DATUM_VALUE, and PartitionRangeDatum::value.
Referenced by get_qual_for_range().
|
static |
Definition at line 4668 of file partbounds.c.
References copyObject, elog, ERROR, fb(), i, IS_NOT_NULL, lappend(), lfirst, list_head(), lnext(), makeNode, makeVar(), and NIL.
Referenced by get_qual_for_range().
|
static |
Definition at line 2574 of file partbounds.c.
References Assert, fb(), get_range_partition_internal(), is_dummy_partition(), and PARTITION_STRATEGY_RANGE.
Referenced by merge_range_bounds().
|
static |
Definition at line 2595 of file partbounds.c.
References Assert, PartitionRangeBound::datums, fb(), PartitionRangeBound::index, PartitionRangeBound::kind, and PartitionRangeBound::lower.
Referenced by get_range_partition().
|
static |
Definition at line 1805 of file partbounds.c.
References PartitionMap::did_remapping, i, PartitionMap::merged, PartitionMap::merged_indexes, PartitionMap::nparts, RelOptInfo::nparts, PartitionMap::old_indexes, and palloc_array.
Referenced by merge_list_bounds(), and merge_range_bounds().
|
static |
Definition at line 1837 of file partbounds.c.
References Assert, fb(), and IS_DUMMY_REL.
Referenced by get_range_partition(), merge_list_bounds(), and merge_range_bounds().
|
static |
Definition at line 3421 of file partbounds.c.
References Assert, castNode, PartitionRangeBound::datums, elog, ERROR, fb(), i, PartitionRangeBound::index, PartitionRangeBound::kind, PartitionRangeDatum::kind, lfirst_node, PartitionRangeBound::lower, lower(), NIL, palloc0_array, palloc0_object, PARTITION_RANGE_DATUM_VALUE, val, and PartitionRangeDatum::value.
Referenced by calculate_partition_bound_for_merge(), check_new_partition_bound(), check_partition_bounds_for_split_range(), check_partitions_for_split(), check_two_partitions_bounds_range(), and create_range_bounds().
|
static |
Definition at line 3860 of file partbounds.c.
References Assert, COERCE_EXPLICIT_CAST, fb(), get_array_type(), get_opcode(), get_partition_operator(), InvalidOid, IsA, lappend(), lfirst, linitial, list_length(), list_make2, make_opclause(), makeBoolExpr(), makeNode, makeRelabelType(), NIL, OR_EXPR, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, and type_is_array.
Referenced by get_qual_for_list(), and get_qual_for_range().
|
static |
Definition at line 2251 of file partbounds.c.
References Assert, fb(), IS_OUTER_JOIN, JOIN_FULL, JOIN_RIGHT, merge_matching_partitions(), and merge_partition_with_dummy().
Referenced by merge_list_bounds(), and merge_range_bounds().
|
static |
Definition at line 1192 of file partbounds.c.
References Assert, build_merged_partition_bounds(), cleanup(), DatumGetInt32(), fb(), fix_merged_indexes(), free_partition_map(), FunctionCall2Coll(), generate_matching_part_pairs(), init_partition_map(), is_dummy_partition(), IS_OUTER_JOIN, JOIN_FULL, lappend(), lappend_int(), list_free(), list_length(), merge_default_partitions(), merge_matching_partitions(), merge_null_partitions(), NIL, partition_bound_accepts_nulls, partition_bound_has_default, PARTITION_STRATEGY_LIST, process_inner_partition(), and process_outer_partition().
Referenced by partition_bounds_merge().
|
static |
Definition at line 1856 of file partbounds.c.
Referenced by merge_default_partitions(), merge_list_bounds(), merge_null_partitions(), merge_range_bounds(), process_inner_partition(), and process_outer_partition().
|
static |
Definition at line 2141 of file partbounds.c.
References Assert, fb(), IS_OUTER_JOIN, JOIN_FULL, JOIN_RIGHT, merge_matching_partitions(), and merge_partition_with_dummy().
Referenced by merge_list_bounds().
|
static |
Definition at line 2361 of file partbounds.c.
References Assert, fb(), PartitionMap::merged, and PartitionMap::merged_indexes.
Referenced by merge_default_partitions(), merge_null_partitions(), process_inner_partition(), and process_outer_partition().
|
static |
Definition at line 1500 of file partbounds.c.
References add_merged_range_bounds(), Assert, build_merged_partition_bounds(), cleanup(), compare_range_bounds, compare_range_partitions(), fb(), free_partition_map(), generate_matching_part_pairs(), get_merged_range_bounds(), get_range_partition(), init_partition_map(), is_dummy_partition(), IS_OUTER_JOIN, JOIN_FULL, list_free(), list_length(), merge_default_partitions(), merge_matching_partitions(), NIL, partition_bound_has_default, PARTITION_STRATEGY_RANGE, process_inner_partition(), and process_outer_partition().
Referenced by partition_bounds_merge().
| PartitionBoundInfo partition_bounds_copy | ( | PartitionBoundInfo | src, |
| PartitionKey | key | ||
| ) |
Definition at line 995 of file partbounds.c.
References Assert, bms_copy(), datumCopy(), PartitionBoundInfoData::datums, PartitionBoundInfoData::default_index, fb(), i, PartitionBoundInfoData::indexes, PartitionBoundInfoData::interleaved_parts, j, PartitionBoundInfoData::kind, PartitionBoundInfoData::ndatums, PartitionBoundInfoData::nindexes, PartitionBoundInfoData::null_index, palloc(), palloc_array, palloc_object, 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 300 of file partbounds.c.
References Assert, create_hash_bounds(), create_list_bounds(), create_range_bounds(), fb(), i, palloc_array, 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 889 of file partbounds.c.
References Assert, datumIsEqual(), fb(), i, j, PARTITION_RANGE_DATUM_VALUE, and PARTITION_STRATEGY_HASH.
Referenced by compute_partition_bounds().
| PartitionBoundInfo partition_bounds_merge | ( | int | partnatts, |
| FmgrInfo * | partsupfunc, | ||
| Oid * | partcollation, | ||
| RelOptInfo * | outer_rel, | ||
| RelOptInfo * | inner_rel, | ||
| JoinType | jointype, | ||
| List ** | outer_parts, | ||
| List ** | inner_parts | ||
| ) |
Definition at line 1112 of file partbounds.c.
References Assert, fb(), 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 3730 of file partbounds.c.
References DatumGetInt32(), PartitionBoundInfoData::datums, fb(), PartitionBoundInfoData::ndatums, partition_hbound_cmp(), and remainder.
Referenced by check_new_partition_bound().
|
static |
Definition at line 3579 of file partbounds.c.
References fb().
Referenced by partition_hash_bsearch(), and qsort_partition_hbound_cmp().
| int partition_list_bsearch | ( | FmgrInfo * | partsupfunc, |
| Oid * | partcollation, | ||
| PartitionBoundInfo | boundinfo, | ||
| Datum | value, | ||
| bool * | is_equal | ||
| ) |
Definition at line 3599 of file partbounds.c.
References DatumGetInt32(), PartitionBoundInfoData::datums, fb(), FunctionCall2Coll(), PartitionBoundInfoData::ndatums, and value.
Referenced by check_new_partition_bound(), check_partition_bounds_for_split_list(), get_matching_list_bounds(), and get_partition_for_tuple().
|
static |
Definition at line 3645 of file partbounds.c.
References PartitionBoundInfoData::datums, fb(), PartitionBoundInfoData::indexes, PartitionBoundInfoData::kind, PartitionBoundInfoData::ndatums, and partition_rbound_cmp().
Referenced by check_new_partition_bound().
| int partition_range_datum_bsearch | ( | FmgrInfo * | partsupfunc, |
| Oid * | partcollation, | ||
| PartitionBoundInfo | boundinfo, | ||
| int | nvalues, | ||
| const Datum * | values, | ||
| bool * | is_equal | ||
| ) |
Definition at line 3687 of file partbounds.c.
References PartitionBoundInfoData::datums, fb(), PartitionBoundInfoData::kind, PartitionBoundInfoData::ndatums, partition_rbound_datum_cmp(), and values.
Referenced by get_matching_range_bounds(), and get_partition_for_tuple().
|
static |
Definition at line 3480 of file partbounds.c.
References DatumGetInt32(), PartitionRangeBound::datums, fb(), FunctionCall2Coll(), i, and PARTITION_RANGE_DATUM_VALUE.
Referenced by add_merged_range_bounds(), check_new_partition_bound(), check_partition_bounds_for_split_range(), check_two_partitions_bounds_range(), and partition_range_bsearch().
| int32 partition_rbound_datum_cmp | ( | FmgrInfo * | partsupfunc, |
| Oid * | partcollation, | ||
| const Datum * | rb_datums, | ||
| PartitionRangeDatumKind * | rb_kind, | ||
| const Datum * | tuple_datums, | ||
| int | n_tuple_datums | ||
| ) |
Definition at line 3548 of file partbounds.c.
References DatumGetInt32(), fb(), 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 2845 of file partbounds.c.
References Assert, bms_is_member(), bms_overlap(), PartitionBoundInfoData::default_index, fb(), 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().
|
static |
Definition at line 5204 of file partbounds.c.
References DatumGetInt32(), fb(), foreach_node, FunctionCall2Coll(), lappend(), and NIL.
Referenced by check_partitions_not_overlap_list().
|
static |
Definition at line 2056 of file partbounds.c.
References Assert, fb(), IS_OUTER_JOIN, JOIN_FULL, JOIN_RIGHT, merge_matching_partitions(), and merge_partition_with_dummy().
Referenced by merge_list_bounds(), and merge_range_bounds().
|
static |
Definition at line 1974 of file partbounds.c.
References Assert, fb(), IS_OUTER_JOIN, JOIN_FULL, JOIN_RIGHT, merge_matching_partitions(), and merge_partition_with_dummy().
Referenced by merge_list_bounds(), and merge_range_bounds().
Definition at line 3770 of file partbounds.c.
References a, b, fb(), and partition_hbound_cmp().
Referenced by create_hash_bounds().
Definition at line 3785 of file partbounds.c.
References a, arg, b, DatumGetInt32(), fb(), and FunctionCall2Coll().
Referenced by create_list_bounds().
Definition at line 3802 of file partbounds.c.
References a, arg, b, compare_range_bounds, and fb().
Referenced by calculate_partition_bound_for_merge(), check_partitions_for_split(), and create_range_bounds().
| Datum satisfies_hash_partition | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4763 of file partbounds.c.
References AccessShareLock, ARR_ELEMTYPE, DatumGetUInt64(), deconstruct_array(), ereport, errcode(), errmsg(), ERROR, fb(), FLEXIBLE_ARRAY_MEMBER, fmgr_info_copy(), format_type_be(), FunctionCall2Coll(), get_fn_expr_argtype(), get_fn_expr_variadic(), get_rel_name(), get_typlenbyvalalign(), hash(), hash_combine64(), HASH_PARTITION_SEED, i, IsBinaryCoercible(), j, MemoryContextAllocZero(), NoLock, OidIsValid, PARTITION_MAX_KEYS, PARTITION_STRATEGY_HASH, PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_GETARG_DATUM, PG_GETARG_INT32, PG_GETARG_OID, PG_NARGS, PG_RETURN_BOOL, relation_close(), relation_open(), RelationGetPartitionKey(), remainder, and UInt64GetDatum().