[FEAT MERGE] impl vectorization 2.0

Co-authored-by: Naynahs <cfzy002@126.com>
Co-authored-by: hwx65 <1780011298@qq.com>
Co-authored-by: oceanoverflow <oceanoverflow@gmail.com>
This commit is contained in:
obdev
2023-12-22 03:43:19 +00:00
committed by ob-robot
parent 1178245448
commit b6773084c6
592 changed files with 358124 additions and 303288 deletions

View File

@ -39,17 +39,30 @@ enum ObPlanCachePolicy
OB_USE_PLAN_CACHE_DEFAULT,//use plan cache
};
struct ObMonitorHint
struct ObAllocOpHint
{
ObMonitorHint(): id_(0), flags_(0) {};
~ObMonitorHint() = default;
ObAllocOpHint() : id_(0), flags_(0), alloc_level_(INVALID_LEVEL) {}
~ ObAllocOpHint() = default;
void reset();
int assign(const ObAllocOpHint& other);
static const int8_t OB_MONITOR_TRACING = 0x1 << 1;
static const int8_t OB_MONITOR_STAT = 0x1 << 2;
static const uint8_t OB_MONITOR_TRACING = 0x1 << 1;
static const uint8_t OB_MONITOR_STAT = 0x1 << 2;
static const uint8_t OB_MATERIAL = 0x1 << 3;
enum AllocLevel
{
INVALID_LEVEL = 0,
OB_ALL,
OB_DFO,
OB_ENUMERATE
};
// Target op id in original plan tree. Material or monitor op will be inserted above target op.
uint64_t id_;
uint64_t flags_;
TO_STRING_KV(K_(id), K_(flags));
AllocLevel alloc_level_;
TO_STRING_KV(K_(id), K_(flags), K_(alloc_level));
};
struct ObDopHint
@ -136,9 +149,9 @@ struct ObGlobalHint {
static const int64_t UNSET_DYNAMIC_SAMPLING = -1;
int merge_global_hint(const ObGlobalHint &other);
int merge_monitor_hints(const ObIArray<ObMonitorHint> &monitoring_ids);
int merge_dop_hint(uint64_t dfo, uint64_t dop);
int merge_dop_hint(const ObIArray<ObDopHint> &dop_hints);
int merge_alloc_op_hints(const ObIArray<ObAllocOpHint> &alloc_op_hints);
void merge_query_timeout_hint(int64_t hint_time);
void reset_query_timeout_hint() { query_timeout_ = -1; }
void merge_dblink_info_hint(int64_t tx_id, int64_t tm_sessid);
@ -157,7 +170,7 @@ struct ObGlobalHint {
bool has_hint_exclude_concurrent() const;
int print_global_hint(PlanText &plan_text) const;
int print_monitoring_hints(PlanText &plan_text) const;
int print_alloc_op_hints(PlanText &plan_text) const;
ObPDMLOption get_pdml_option() const { return pdml_option_; }
ObParamOption get_param_option() const { return param_option_; }
@ -226,7 +239,7 @@ struct ObGlobalHint {
K_(monitor),
K_(pdml_option),
K_(param_option),
K_(monitoring_ids),
K_(alloc_op_hints),
K_(dops),
K_(opt_features_version),
K_(disable_transform),
@ -236,7 +249,8 @@ struct ObGlobalHint {
K_(ob_ddl_schema_versions),
K_(osg_hint),
K_(has_dbms_stats_hint),
K_(dynamic_sampling));
K_(dynamic_sampling),
K_(alloc_op_hints));
int64_t frozen_version_;
int64_t topk_precision_;
@ -255,7 +269,6 @@ struct ObGlobalHint {
bool monitor_;
ObPDMLOption pdml_option_;
ObParamOption param_option_;
common::ObSArray<ObMonitorHint> monitoring_ids_;
common::ObSArray<ObDopHint> dops_;
uint64_t opt_features_version_;
bool disable_transform_;
@ -267,6 +280,7 @@ struct ObGlobalHint {
bool has_dbms_stats_hint_;
bool flashback_read_tx_uncommitted_;
int64_t dynamic_sampling_;
common::ObSArray<ObAllocOpHint> alloc_op_hints_;
};
// used in physical plan