[FEAT MERGE] [CP] Improve the rowcount estimation

Co-authored-by: akaError <lzg020616@163.com>
This commit is contained in:
xianyu-w
2024-01-22 04:12:26 +00:00
committed by ob-robot
parent a125d6cf00
commit d2ab1a4aae
70 changed files with 5953 additions and 3722 deletions

View File

@ -33,14 +33,17 @@ class OptSelectivityCtx;
class ObOptCostModelParameter;
class OptSystemStat;
enum RowCountEstMethod
enum RowCountEstMethod { INVALID_METHOD = 0 }; // deprecated
enum ObBaseTableEstBasicMethod
{
INVALID_METHOD = 0,
DEFAULT_STAT,
BASIC_STAT, //use min/max/ndv to estimate row count
STORAGE_STAT, //use storage layer to estimate row count
DYNAMIC_SAMPLING_STAT //use dynamic sampling to estimate row count
EST_INVALID = 0,
EST_DEFAULT = 1 << 0,
EST_STAT = 1 << 1,
EST_STORAGE = 1 << 2,
EST_DS_BASIC = 1 << 3,
EST_DS_FULL = 1 << 4,
};
typedef uint64_t ObBaseTableEstMethod;
// all the table meta info need to compute cost
struct ObTableMetaInfo
@ -216,7 +219,7 @@ struct ObCostTableScanInfo
table_filters_(),
table_metas_(NULL),
sel_ctx_(NULL),
row_est_method_(RowCountEstMethod::INVALID_METHOD),
est_method_(EST_INVALID),
prefix_filter_sel_(1.0),
pushdown_prefix_filter_sel_(1.0),
postfix_filter_sel_(1.0),
@ -242,7 +245,7 @@ struct ObCostTableScanInfo
K_(table_meta_info), K_(index_meta_info),
K_(access_column_items),
K_(is_virtual_table), K_(is_unique),
K_(is_inner_path), K_(can_use_batch_nlj),
K_(is_inner_path), K_(can_use_batch_nlj), K_(est_method),
K_(prefix_filter_sel), K_(pushdown_prefix_filter_sel),
K_(postfix_filter_sel), K_(table_filter_sel),
K_(ss_prefix_ndv), K_(ss_postfix_range_filters_sel),
@ -278,7 +281,7 @@ struct ObCostTableScanInfo
OptTableMetas *table_metas_;
OptSelectivityCtx *sel_ctx_;
// the following information are useful when estimating cost
RowCountEstMethod row_est_method_; // row_est_method
ObBaseTableEstMethod est_method_;
double prefix_filter_sel_;
double pushdown_prefix_filter_sel_;
double postfix_filter_sel_;