diff --git a/src/sql/optimizer/ob_access_path_estimation.cpp b/src/sql/optimizer/ob_access_path_estimation.cpp index 82f4aa840..6fd5415f5 100644 --- a/src/sql/optimizer/ob_access_path_estimation.cpp +++ b/src/sql/optimizer/ob_access_path_estimation.cpp @@ -35,13 +35,41 @@ int ObAccessPathEstimation::estimate_rowcount(ObOptimizerContext &ctx, ObBaseTableEstMethod &method) { int ret = OB_SUCCESS; - ObBaseTableEstMethod valid_methods = 0; - method = EST_INVALID; + ObSEArray normal_paths; + ObSEArray geo_paths; + ObBaseTableEstMethod geo_method; if (OB_UNLIKELY(paths.empty())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ret)); - } else if (OB_FAIL(get_valid_est_methods(ctx, paths, filter_exprs, is_inner_path, valid_methods))) { + } else if (is_inner_path) { + if (OB_FAIL(inner_estimate_rowcount(ctx, paths, is_inner_path, filter_exprs, method))) { + LOG_WARN("failed to do estimate rowcount for paths", K(ret)); + } + } else if (OB_FAIL(classify_paths(paths, normal_paths, geo_paths))) { + LOG_WARN("failed to classify paths", K(ret)); + } else if (!normal_paths.empty() && + OB_FAIL(inner_estimate_rowcount(ctx, normal_paths, is_inner_path, filter_exprs, method))) { + LOG_WARN("failed to do estimate rowcount for normal paths", K(ret)); + } else if (!geo_paths.empty() && + OB_FAIL(inner_estimate_rowcount(ctx, geo_paths, is_inner_path, filter_exprs, geo_method))) { + LOG_WARN("failed to do estimate rowcount for geo paths", K(ret)); + } else if (normal_paths.empty() && !geo_paths.empty()) { + method = geo_method; + } + return ret; +} + +int ObAccessPathEstimation::inner_estimate_rowcount(ObOptimizerContext &ctx, + common::ObIArray &paths, + const bool is_inner_path, + const ObIArray &filter_exprs, + ObBaseTableEstMethod &method) + { + int ret = OB_SUCCESS; + ObBaseTableEstMethod valid_methods = 0; + method = EST_INVALID; + if (OB_FAIL(get_valid_est_methods(ctx, paths, filter_exprs, is_inner_path, valid_methods))) { LOG_WARN("failed to get valid est methods", K(ret)); } else if (OB_FAIL(choose_best_est_method(ctx, paths, filter_exprs, valid_methods, method))) { LOG_WARN("failed to choose one est method", K(ret), K(valid_methods)); @@ -400,7 +428,7 @@ int ObAccessPathEstimation::check_path_can_use_storage_estimation(const AccessPa int64_t partition_count = part_info->get_phy_tbl_location_info().get_partition_cnt(); if (partition_count > 1 || scan_range_count <= 0 || - scan_range_count > ObOptEstCost::MAX_STORAGE_RANGE_ESTIMATION_NUM) { + (!path->est_cost_info_.index_meta_info_.is_geo_index_ && scan_range_count > ObOptEstCost::MAX_STORAGE_RANGE_ESTIMATION_NUM)) { can_use = false; } else { can_use = true; @@ -2061,5 +2089,25 @@ bool ObAccessPathEstimation::is_retry_ret(int ret) ret == OB_TABLET_NOT_EXIST; } +int ObAccessPathEstimation::classify_paths(ObIArray &paths, + ObIArray &normal_paths, + ObIArray &geo_paths) +{ + int ret = OB_SUCCESS; + for (int64_t i = 0; OB_SUCC(ret) && i < paths.count(); ++i) { + if (OB_ISNULL(paths.at(i))) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("get null path", K(ret)); + } else if (paths.at(i)->est_cost_info_.index_meta_info_.is_geo_index_) { + if (OB_FAIL(geo_paths.push_back(paths.at(i)))) { + LOG_WARN("failed to push back geo path", K(ret)); + } + } else if (OB_FAIL(normal_paths.push_back(paths.at(i)))) { + LOG_WARN("failed to push back normal path", K(ret)); + } + } + return ret; +} + } // end of sql } // end of oceanbase diff --git a/src/sql/optimizer/ob_access_path_estimation.h b/src/sql/optimizer/ob_access_path_estimation.h index 6e4efadce..a3f4986e3 100644 --- a/src/sql/optimizer/ob_access_path_estimation.h +++ b/src/sql/optimizer/ob_access_path_estimation.h @@ -55,6 +55,12 @@ public: uint64_t ref_table_id, bool &can_use); private: + static int inner_estimate_rowcount(ObOptimizerContext &ctx, + common::ObIArray &paths, + const bool is_inner_path, + const ObIArray &filter_exprs, + ObBaseTableEstMethod &method); + static inline uint64_t choose_one_est_method(ObBaseTableEstMethod valid_methods, const ObBaseTableEstMethod est_priority[], uint64_t cnt) { ObBaseTableEstMethod ret = EST_INVALID; @@ -238,6 +244,9 @@ private: ObIArray &paths, const bool is_inner_path, ObIArray &ds_result_items); + static int classify_paths(common::ObIArray &paths, + common::ObIArray &normal_paths, + common::ObIArray &geo_paths); }; } diff --git a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_bugfix_mysql.result b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_bugfix_mysql.result index 4c183a959..8c50e4871 100644 --- a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_bugfix_mysql.result +++ b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_bugfix_mysql.result @@ -389,7 +389,7 @@ Query Plan ===================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ----------------------------------------------------- -|0 |TABLE FULL SCAN|tt1(idx05)|1 |299 | +|0 |TABLE FULL SCAN|tt1(idx05)|1 |159 | ===================================================== Outputs & filters: ------------------------------------- @@ -583,3 +583,94 @@ SELECT ST_ASTEXT(B) FROM FF01 WHERE B NOT IN (SELECT /*+no_unnest*/B FROM FF01 W ST_ASTEXT(B) POINT(-1 -2) drop table FF01; +drop table if exists geek_poi_7; +CREATE TABLE `geek_poi_7` ( +`p_id` bigint(20) NOT NULL COMMENT 'poi id', +`p_name` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '场景名称', +`p_branch_name` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '分店名称', +`p_phone1` varchar(20) NOT NULL DEFAULT '\'\'' COMMENT '联系电话1', +`p_phone2` varchar(20) NOT NULL DEFAULT '\'\'' COMMENT '联系电话2', +`p_logo_url` longtext NOT NULL COMMENT '场景LOGO URL', +`p_scene_url` longtext NOT NULL COMMENT '场景主页URL', +`p_quickapp_url` longtext NOT NULL COMMENT '快应用场景主页URL', +`p_service_list` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '服务列表,json数组', +`c_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '分类ID', +`p_radius` double NOT NULL DEFAULT '0' COMMENT '半径大小,单位 m', +`p_province` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '省', +`p_city` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '市', +`p_district` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '区县', +`p_address` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '详细地址', +`p_longitude` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '经度', +`p_latitude` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '纬度', +`p_altitude` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '海拔高度', +`p_baidu_id` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '百度城市ID', +`p_parent_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '父级poi id', +`p_parent_list` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '父级poi 列表', +`pn_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '合作方ID,默认为 0 - 梦享网络', +`pb_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '品牌id', +`p_order` bigint(20) NOT NULL DEFAULT '0' COMMENT '排序次序', +`p_coordinate` bigint(20) NOT NULL DEFAULT '0' COMMENT '坐标系 0 - WGS84 # 1 - GCJ02 # 2 - BD09', +`p_category_list` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT 'poi 分类ID列表', +`geohash_code` varchar(20) NOT NULL DEFAULT '\'\'' COMMENT 'geog_poi 转换为 geohash 的值', +`p_create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间', +`p_update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间', +`p_delete_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间', +`p_encryption_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'POI 加密ID', +`p_class` bigint(20) NOT NULL DEFAULT '0' COMMENT '场景等级', +`p_config` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '配置项,JSON对象', +`p_tags_id` json NOT NULL COMMENT '标签列表', +`geog_poi` geometry NOT NULL /*!80003 SRID 4326 */ COMMENT '经纬度转换后的WGS84坐标对应的geography数据', +PRIMARY KEY (`p_id`), +SPATIAL KEY `idx_geohash_code_geog_poi_7` (`geog_poi`) BLOCK_SIZE 16384 LOCAL, +KEY `idx_poi_del_time_7` (`p_delete_time`) BLOCK_SIZE 16384 LOCAL +); +explain EXTENDED_NOADDR SELECT p.p_id,0 as distance FROM geek_poi_7 as p WHERE p.geohash_code like 'ws0emp%' and p.p_delete_time = 0 AND ST_Contains(p.geog_poi,_ST_GeogFromText('POINT(113.42416381835938 23.11138916015625)')); +Query Plan +=============================================== +|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)| +----------------------------------------------- +|0 |TABLE FULL SCAN|p |64 |2813 | +=============================================== +Outputs & filters: +------------------------------------- + 0 - output([p.p_id], [0]), filter([p.p_delete_time = 0], [(T_OP_LIKE, p.geohash_code, 'ws0emp%', '\\')], [BOOL(ST_Contains(p.geog_poi, _ST_GeogFromText('POINT(113.42416381835938 + 23.11138916015625)')))]) + access([p.p_id], [p.geog_poi], [p.geohash_code], [p.p_delete_time]), partitions(p0) + is_index_back=false, is_global_index=false, filter_before_indexback[false,false,false], + range_key([p.p_id]), range(MIN ; MAX)always true +Used Hint: +------------------------------------- + /*+ + + */ +Qb name trace: +------------------------------------- + stmt_id:0, stmt_type:T_EXPLAIN + stmt_id:1, SEL$1 +Outline Data: +------------------------------------- + /*+ + BEGIN_OUTLINE_DATA + FULL(@"SEL$1" "p"@"SEL$1") + OPTIMIZER_FEATURES_ENABLE('') + END_OUTLINE_DATA + */ +Optimization Info: +------------------------------------- + p: + table_rows:10002 + physical_range_rows:10002 + logical_range_rows:10002 + index_back_rows:0 + output_rows:1 + table_dop:1 + dop_method:Table DOP + avaiable_index_name:[idx_geohash_code_geog_poi_7, idx_poi_del_time_7, geek_poi_7] + pruned_index_name:[idx_geohash_code_geog_poi_7] + stats version:0 + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] + Plan Type: + LOCAL + Note: + Degree of Parallelisim is 1 because of table property diff --git a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_filter_mysql.result b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_filter_mysql.result index 62017d112..74ac7e323 100644 --- a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_filter_mysql.result +++ b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_filter_mysql.result @@ -83,7 +83,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |355 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -125,17 +125,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 + physical_range_rows:12 + logical_range_rows:12 + index_back_rows:3 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -145,7 +145,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |355 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -187,17 +187,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 + physical_range_rows:12 + logical_range_rows:12 + index_back_rows:3 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -207,7 +207,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |355 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -249,17 +249,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 + physical_range_rows:12 + logical_range_rows:12 + index_back_rows:3 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -269,7 +269,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |363 | +|0 |TABLE FULL SCAN|t(idx)|2 |879 | ================================================= Outputs & filters: ------------------------------------- @@ -312,17 +312,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 - output_rows:0 + physical_range_rows:26 + logical_range_rows:26 + index_back_rows:6 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -332,7 +332,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |355 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -374,17 +374,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 + physical_range_rows:12 + logical_range_rows:12 + index_back_rows:3 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -394,7 +394,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |359 | +|0 |TABLE FULL SCAN|t(idx)|1 |493 | ================================================= Outputs & filters: ------------------------------------- @@ -437,17 +437,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 + physical_range_rows:12 + logical_range_rows:12 + index_back_rows:3 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -457,7 +457,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |351 | +|0 |TABLE FULL SCAN|t(idx)|2 |799 | ================================================= Outputs & filters: ------------------------------------- @@ -500,17 +500,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 - output_rows:0 + physical_range_rows:24 + logical_range_rows:24 + index_back_rows:6 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -520,7 +520,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |355 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -562,17 +562,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:2 + physical_range_rows:12 + logical_range_rows:12 + index_back_rows:3 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -641,7 +641,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|2 |166 | +|0 |TABLE FULL SCAN|t(idx)|3 |185 | ================================================= Outputs & filters: ------------------------------------- @@ -683,17 +683,17 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 - index_back_rows:3 - output_rows:1 + physical_range_rows:12 + logical_range_rows:12 + index_back_rows:5 + output_rows:2 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -703,7 +703,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |338 | +|0 |TABLE FULL SCAN|t(idx)|1 |453 | ================================================= Outputs & filters: ------------------------------------- @@ -745,8 +745,8 @@ Optimization Info: ------------------------------------- t: table_rows:8 - physical_range_rows:8 - logical_range_rows:8 + physical_range_rows:12 + logical_range_rows:12 index_back_rows:0 output_rows:0 table_dop:1 @@ -754,8 +754,8 @@ Optimization Info: avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -972,7 +972,7 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ----------------------------------------------------------- -|0 |TABLE FULL SCAN|geo_table2(geom)|1 |187 | +|0 |TABLE FULL SCAN|geo_table2(geom)|1 |305 | =========================================================== Outputs & filters: ------------------------------------- @@ -1016,17 +1016,17 @@ Optimization Info: ------------------------------------- geo_table2: table_rows:2 - physical_range_rows:2 - logical_range_rows:2 - index_back_rows:0 + physical_range_rows:6 + logical_range_rows:6 + index_back_rows:1 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[geom, geo_table2] pruned_index_name:[geo_table2] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1042,7 +1042,7 @@ Query Plan =========================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ----------------------------------------------------------- -|0 |TABLE FULL SCAN|geo_table2(geom)|1 |187 | +|0 |TABLE FULL SCAN|geo_table2(geom)|1 |305 | =========================================================== Outputs & filters: ------------------------------------- @@ -1086,17 +1086,17 @@ Optimization Info: ------------------------------------- geo_table2: table_rows:2 - physical_range_rows:2 - logical_range_rows:2 - index_back_rows:0 + physical_range_rows:6 + logical_range_rows:6 + index_back_rows:1 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[geom, geo_table2] pruned_index_name:[geo_table2] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1127,8 +1127,8 @@ Query Plan ============================================================ |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------------------ -|0 |SORT | |1 |299 | -|1 |└─TABLE FULL SCAN|geo_table(geom)|1 |299 | +|0 |SORT | |1 |305 | +|1 |└─TABLE FULL SCAN|geo_table(geom)|1 |305 | ============================================================ Outputs & filters: ------------------------------------- @@ -1181,8 +1181,8 @@ Optimization Info: avaiable_index_name:[geom, geo_table] pruned_index_name:[geo_table] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1348,7 +1348,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -1390,17 +1390,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1410,7 +1410,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -1452,17 +1452,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1472,7 +1472,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -1514,17 +1514,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1534,7 +1534,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |540 | +|0 |TABLE FULL SCAN|t(idx)|3 |1128 | ================================================= Outputs & filters: ------------------------------------- @@ -1578,17 +1578,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:35 + logical_range_rows:35 + index_back_rows:8 + output_rows:2 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1598,7 +1598,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -1640,17 +1640,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1660,7 +1660,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |527 | +|0 |TABLE FULL SCAN|t(idx)|2 |1031 | ================================================= Outputs & filters: ------------------------------------- @@ -1703,17 +1703,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:32 + logical_range_rows:32 + index_back_rows:8 + output_rows:2 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1723,7 +1723,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |519 | +|0 |TABLE FULL SCAN|t(idx)|1 |295 | ================================================= Outputs & filters: ------------------------------------- @@ -1766,17 +1766,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 + physical_range_rows:6 + logical_range_rows:6 + index_back_rows:1 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1786,7 +1786,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -1828,17 +1828,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -1960,7 +1960,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2002,17 +2002,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2022,7 +2022,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2064,17 +2064,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2084,7 +2084,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2126,17 +2126,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2146,7 +2146,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |531 | +|0 |TABLE FULL SCAN|t(idx)|4 |1526 | ================================================= Outputs & filters: ------------------------------------- @@ -2189,17 +2189,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:49 + logical_range_rows:49 + index_back_rows:12 + output_rows:3 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2209,7 +2209,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2251,17 +2251,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2271,7 +2271,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |527 | +|0 |TABLE FULL SCAN|t(idx)|2 |1031 | ================================================= Outputs & filters: ------------------------------------- @@ -2314,17 +2314,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:32 + logical_range_rows:32 + index_back_rows:8 + output_rows:2 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2334,7 +2334,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |519 | +|0 |TABLE FULL SCAN|t(idx)|3 |1387 | ================================================= Outputs & filters: ------------------------------------- @@ -2377,17 +2377,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:45 + logical_range_rows:45 + index_back_rows:11 + output_rows:2 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2397,7 +2397,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2439,17 +2439,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2459,7 +2459,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2501,17 +2501,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2521,7 +2521,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2563,17 +2563,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2583,7 +2583,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2625,17 +2625,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2645,7 +2645,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |540 | +|0 |TABLE FULL SCAN|t(idx)|3 |1128 | ================================================= Outputs & filters: ------------------------------------- @@ -2689,17 +2689,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:35 + logical_range_rows:35 + index_back_rows:8 + output_rows:2 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2709,7 +2709,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2751,17 +2751,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2771,7 +2771,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |527 | +|0 |TABLE FULL SCAN|t(idx)|2 |1031 | ================================================= Outputs & filters: ------------------------------------- @@ -2814,17 +2814,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:32 + logical_range_rows:32 + index_back_rows:8 + output_rows:2 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2834,7 +2834,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |519 | +|0 |TABLE FULL SCAN|t(idx)|1 |295 | ================================================= Outputs & filters: ------------------------------------- @@ -2877,17 +2877,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 + physical_range_rows:6 + logical_range_rows:6 + index_back_rows:1 output_rows:0 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -2897,7 +2897,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |523 | +|0 |TABLE FULL SCAN|t(idx)|2 |999 | ================================================= Outputs & filters: ------------------------------------- @@ -2939,17 +2939,17 @@ Optimization Info: ------------------------------------- t: table_rows:14 - physical_range_rows:14 - logical_range_rows:14 - index_back_rows:3 - output_rows:0 + physical_range_rows:31 + logical_range_rows:31 + index_back_rows:7 + output_rows:1 table_dop:1 dop_method:Table DOP avaiable_index_name:[idx, t] pruned_index_name:[t] stats version:0 - dynamic sampling level:1 - estimation method:[DYNAMIC SAMPLING BASIC] + dynamic sampling level:0 + estimation method:[DEFAULT, STORAGE] Plan Type: LOCAL Note: @@ -3201,7 +3201,7 @@ Query Plan ======================================================================================== |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ---------------------------------------------------------------------------------------- -|0 |TABLE FULL SCAN|spatial_point_in_line(index_spatial_line_geo)|1 |279 | +|0 |TABLE FULL SCAN|spatial_point_in_line(index_spatial_line_geo)|1 |324 | ======================================================================================== Outputs & filters: ------------------------------------- diff --git a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index2_mysql.result b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index2_mysql.result index 732037e7e..f36c28fba 100644 --- a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index2_mysql.result +++ b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index2_mysql.result @@ -540,7 +540,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -565,7 +565,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -590,7 +590,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -615,7 +615,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -640,7 +640,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -665,7 +665,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -690,7 +690,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -715,7 +715,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -740,7 +740,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |304 | ================================================= Outputs & filters: ------------------------------------- @@ -765,7 +765,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |304 | ================================================= Outputs & filters: ------------------------------------- @@ -790,7 +790,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |304 | ================================================= Outputs & filters: ------------------------------------- @@ -815,7 +815,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |304 | ================================================= Outputs & filters: ------------------------------------- @@ -840,7 +840,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -865,7 +865,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |478 | ================================================= Outputs & filters: ------------------------------------- @@ -947,7 +947,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -972,7 +972,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -997,7 +997,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1022,7 +1022,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1047,7 +1047,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1072,7 +1072,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1097,7 +1097,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1122,7 +1122,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1147,7 +1147,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1172,7 +1172,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1197,7 +1197,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1222,7 +1222,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |218 | ================================================= Outputs & filters: ------------------------------------- @@ -1247,7 +1247,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |159 | ================================================= Outputs & filters: ------------------------------------- @@ -1272,7 +1272,7 @@ Query Plan ================================================= |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| ------------------------------------------------- -|0 |TABLE FULL SCAN|t(idx)|1 |299 | +|0 |TABLE FULL SCAN|t(idx)|1 |159 | ================================================= Outputs & filters: ------------------------------------- diff --git a/tools/deploy/mysql_test/test_suite/geometry/t/geometry_bugfix_mysql.test b/tools/deploy/mysql_test/test_suite/geometry/t/geometry_bugfix_mysql.test index 2094833ac..12f04017f 100644 --- a/tools/deploy/mysql_test/test_suite/geometry/t/geometry_bugfix_mysql.test +++ b/tools/deploy/mysql_test/test_suite/geometry/t/geometry_bugfix_mysql.test @@ -357,3 +357,62 @@ INSERT INTO FF01 VALUES (2,POINT(1,2)); INSERT INTO FF01 VALUES (3,POINT(-1,-2)); SELECT ST_ASTEXT(B) FROM FF01 WHERE B NOT IN (SELECT /*+no_unnest*/B FROM FF01 WHERE B=POINT(1,2)); drop table FF01; + +--disable_warnings +drop table if exists geek_poi_7; +--enable_warnings + +CREATE TABLE `geek_poi_7` ( + `p_id` bigint(20) NOT NULL COMMENT 'poi id', + `p_name` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '场景名称', + `p_branch_name` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '分店名称', + `p_phone1` varchar(20) NOT NULL DEFAULT '\'\'' COMMENT '联系电话1', + `p_phone2` varchar(20) NOT NULL DEFAULT '\'\'' COMMENT '联系电话2', + `p_logo_url` longtext NOT NULL COMMENT '场景LOGO URL', + `p_scene_url` longtext NOT NULL COMMENT '场景主页URL', + `p_quickapp_url` longtext NOT NULL COMMENT '快应用场景主页URL', + `p_service_list` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '服务列表,json数组', + `c_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '分类ID', + `p_radius` double NOT NULL DEFAULT '0' COMMENT '半径大小,单位 m', + `p_province` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '省', + `p_city` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '市', + `p_district` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '区县', + `p_address` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '详细地址', + `p_longitude` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '经度', + `p_latitude` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '纬度', + `p_altitude` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '海拔高度', + `p_baidu_id` varchar(45) NOT NULL DEFAULT '\'\'' COMMENT '百度城市ID', + `p_parent_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '父级poi id', + `p_parent_list` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '父级poi 列表', + `pn_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '合作方ID,默认为 0 - 梦享网络', + `pb_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '品牌id', + `p_order` bigint(20) NOT NULL DEFAULT '0' COMMENT '排序次序', + `p_coordinate` bigint(20) NOT NULL DEFAULT '0' COMMENT '坐标系 0 - WGS84 # 1 - GCJ02 # 2 - BD09', + `p_category_list` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT 'poi 分类ID列表', + `geohash_code` varchar(20) NOT NULL DEFAULT '\'\'' COMMENT 'geog_poi 转换为 geohash 的值', + `p_create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间', + `p_update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间', + `p_delete_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间', + `p_encryption_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'POI 加密ID', + `p_class` bigint(20) NOT NULL DEFAULT '0' COMMENT '场景等级', + `p_config` varchar(255) NOT NULL DEFAULT '\'\'' COMMENT '配置项,JSON对象', + `p_tags_id` json NOT NULL COMMENT '标签列表', + `geog_poi` geometry NOT NULL /*!80003 SRID 4326 */ COMMENT '经纬度转换后的WGS84坐标对应的geography数据', + PRIMARY KEY (`p_id`), + SPATIAL KEY `idx_geohash_code_geog_poi_7` (`geog_poi`) BLOCK_SIZE 16384 LOCAL, + KEY `idx_poi_del_time_7` (`p_delete_time`) BLOCK_SIZE 16384 LOCAL +); + +--disable_query_log +--disable_result_log +insert into geek_poi_7(p_id, p_logo_url,p_scene_url,p_quickapp_url, p_tags_id,geog_poi,p_delete_time) values(0, 'aaa','aaa','aaa','[]', st_geomfromtext('POINT(23.11138916015625 113.42416381835938)', 4326), 0); +let $i = 1; +while ($i <= 10000) +{ + eval insert into geek_poi_7(p_id, p_logo_url,p_scene_url,p_quickapp_url, p_tags_id,geog_poi,p_delete_time) values($i, 'aaa','aaa','aaa','[]', st_geomfromtext('POINT(33.11138916015625 123.42416381835938)', 4326), $i%2); + inc $i; +} +--enable_query_log +--enable_result_log + +explain EXTENDED_NOADDR SELECT p.p_id,0 as distance FROM geek_poi_7 as p WHERE p.geohash_code like 'ws0emp%' and p.p_delete_time = 0 AND ST_Contains(p.geog_poi,_ST_GeogFromText('POINT(113.42416381835938 23.11138916015625)'));