openGauss资源池化支持多机并行

This commit is contained in:
quemingjian
2023-10-12 18:39:23 +08:00
parent c1aaeea5b2
commit ea7ff3627b
140 changed files with 10069 additions and 353 deletions

View File

@ -19,6 +19,9 @@
#include "catalog/pg_workload_group.h"
#include "catalog/pg_app_workloadgroup_mapping.h"
#include "catalog/pgxc_node.h"
#ifdef USE_SPQ
#include "parser/parse_coerce.h"
#endif
/* Result list element for get_op_btree_interpretation */
typedef struct OpBtreeInterpretation {
@ -220,6 +223,75 @@ extern bool get_func_iswindow(Oid funcid);
extern char get_func_prokind(Oid funcid);
extern char get_typecategory(Oid typid);
#ifdef USE_SPQ
/* comparison types */
typedef enum CmpType {
CmptEq, // equality
CmptNEq, // inequality
CmptLT, // less than
CmptLEq, // less or equal to
CmptGT, // greater than
CmptGEq, // greater or equal to
CmptOther // other operator
} CmpType;
#define ATTSTATSSLOT_VALUES 0x01
#define ATTSTATSSLOT_NUMBERS 0x02
/* Result struct for get_attstatsslot */
typedef struct AttStatsSlot {
/* Always filled: */
Oid staop; /* Actual staop for the found slot */
Oid stacoll; /* Actual collation for the found slot */
/* Filled if ATTSTATSSLOT_VALUES is specified: */
Oid valuetype; /* Actual datatype of the values */
Datum *values; /* slot's "values" array, or NULL if none */
int nvalues; /* length of values[], or 0 */
/* Filled if ATTSTATSSLOT_NUMBERS is specified: */
float4 *numbers; /* slot's "numbers" array, or NULL if none */
int nnumbers; /* length of numbers[], or 0 */
/* Remaining fields are private to get_attstatsslot/free_attstatsslot */
void *values_arr; /* palloc'd values array, if any */
void *numbers_arr; /* palloc'd numbers array, if any */
} AttStatsSlot;
extern Oid get_compatible_hash_opfamily(Oid opno);
extern Oid get_compatible_legacy_hash_opfamily(Oid opno);
extern void MemoryContextDeclareAccountingRoot(MemoryContext context);
extern Oid get_agg_transtype(Oid aggid);
extern bool is_agg_ordered(Oid aggid);
extern bool is_agg_partial_capable(Oid aggid);
extern List *get_func_output_arg_types(Oid funcid);
extern List *get_func_arg_types(Oid funcid);
extern char func_data_access(Oid funcid);
extern char func_exec_location(Oid funcid);
extern bool index_exists(Oid oid);
extern bool aggregate_exists(Oid oid);
extern Oid get_aggregate(const char *aggname, Oid oidType);
extern bool function_exists(Oid oid);
extern bool get_cast_func(Oid oidSrc, Oid oidDest, bool *is_binary_coercible, Oid *oidCastFunc, CoercionPathType *pathtype);
extern bool check_constraint_exists(Oid oidCheckconstraint);
extern char *get_check_constraint_name(Oid oidCheckconstraint);
extern Oid get_check_constraint_relid(Oid oidCheckconstraint);
extern List *get_check_constraint_oids(Oid oidRel);
extern Node *get_check_constraint_expr_tree(Oid oidCheckconstraint);
extern bool operator_exists(Oid oid);
extern bool relation_exists(Oid oid);
extern bool type_exists(Oid oid);
extern CmpType get_comparison_type(Oid oidOp);
extern Oid get_comparison_operator(Oid oidLeft, Oid oidRight, CmpType cmpt);
extern bool has_subclass_slow(Oid relationId);
extern List *get_operator_opfamilies(Oid opno);
extern List *get_index_opfamilies(Oid oidIndex);
extern bool relation_is_partitioned(Oid oid);
extern bool index_is_partitioned(Oid oid);
extern bool has_update_triggers(Oid relid);
extern bool spq_get_attstatsslot(AttStatsSlot *sslot, HeapTuple statstuple, int reqkind, Oid reqop, int flags);
extern void spq_free_attstatsslot(AttStatsSlot *sslot);
extern char * get_type_name(Oid typid);
extern int32 get_trigger_type(Oid triggerid);
extern HeapTuple get_att_stats(Oid relid, AttrNumber attrnum);
#endif
#define type_is_array(typid) (get_element_type(typid) != InvalidOid)
/* type_is_array_domain accepts both plain arrays and domains over arrays */
#define type_is_array_domain(typid) (get_base_element_type(typid) != InvalidOid)

View File

@ -352,6 +352,7 @@ extern bool numericvar_to_int64(const NumericVar* var, int64* result, bool can_i
extern void int64_to_numericvar(int64 val, NumericVar *var);
extern void add_var(NumericVar *var1, NumericVar *var2, NumericVar *result);
extern char *numeric_normalize(Numeric num);
extern double numeric_to_double_no_overflow(Numeric num);
bool numeric_agg_trans_initvalisnull(Oid transfn_oid, bool initvalisnull);
void numeric_transfn_info_change(Oid aggfn_oid, Oid *transfn_oid, Oid *transtype);

View File

@ -411,6 +411,10 @@ typedef struct StdRdOptions {
int check_option_offset; /* for views */
int view_security_option_offset; /* for views */
Oid collate; /* table's default collation in b format. */
#ifdef USE_SPQ
/* SPQ OPTIONS */
int spq_bt_build_offset;
#endif
} StdRdOptions;
#define HEAP_MIN_FILLFACTOR 10

View File

@ -288,4 +288,5 @@ extern void set_varratio_after_calc_selectivity(
extern double get_windowagg_selectivity(PlannerInfo* root, WindowClause* wc, WindowFunc* wfunc, List* partitionExprs,
int32 constval, double tuples, unsigned int num_datanodes);
extern bool contain_single_col_stat(List* stat_list);
extern double convert_timevalue_to_scalar(Datum value, Oid typid);
#endif /* SELFUNCS_H */