Files
oceanbase/unittest/sql/optimizer/opt_est/test_sel_hist.result
wangzelin.wzl 93a1074b0c patch 4.0
2022-10-24 17:57:12 +08:00

118 lines
6.3 KiB
Plaintext

******************CASE0******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :density * num_null = 0.002
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 = 10;
SELECTIVITY = 0
******************CASE1******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :density * num_null = 0.002
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 = 5.5;
SELECTIVITY = 0
******************CASE2******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :density * num_null = 0.002
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 > 20;
SELECTIVITY = 0.97
******************CASE3******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :density * num_null = 0.002
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 < 1;
SELECTIVITY = 0.0475
******************CASE4******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :5/200 * 0.8 = 0.02
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 = 1;
SELECTIVITY = 0
******************CASE5******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :(5/200 + 0.0025) * 0.8 = 0.022
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 <= 1;
SELECTIVITY = 0.0475
******************CASE6******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :(103 - 5) / 200 * 0.8 = 0.392
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 >= 2 and c1 <= 10;
SELECTIVITY = 0.0025
******************CASE7******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :((103 - 5) / 200) * 0.8 = 0.392
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 > 1.5 and c1 <= 10;
SELECTIVITY = 0.00645
******************CASE8******************
min = 1, max = 20, ndv = 20, null_num = 50
num_row = 250, density = 0.0025, bucket count = 200
the ratio of not null row is (250-50)/250 = 0.8
| val | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| cnt | 5 | 14 | 13 | 16 | 9 | 7 | 10 | 13 | 15 | 1 | 5 | 6 | 10 | 9 | 9 | 12 | 21 | 11 | 11 | 3 |
| acc | 5 | 19 | 32 | 48 | 57 | 64 | 74 | 87 | 102 | 103 | 108 | 114 | 124 | 133 | 142 | 154 | 175 | 186 | 197 | 200 |
EXPECTED RESULT :((103 - 5) / 200 + 0.0025) * 0.8 = 0.393
----------------------------------------------------------
EXPR_STR: select c1 from t1 where c1 >= 2 and c1 < 10.5;
SELECTIVITY = 0.04085