Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fcf58a5e
Commit
fcf58a5e
authored
Aug 29, 2021
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup part#2: do not copy key values in xxx_selectivity() functions
parent
2a1cdbab
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
122 deletions
+85
-122
mysql-test/main/statistics_json.result
mysql-test/main/statistics_json.result
+5
-5
sql/sql_statistics.cc
sql/sql_statistics.cc
+78
-113
sql/sql_statistics.h
sql/sql_statistics.h
+2
-4
No files found.
mysql-test/main/statistics_json.result
View file @
fcf58a5e
...
...
@@ -2444,15 +2444,15 @@ test t1_json a a-0 a-9 0.0000 3.0000 1.0000 100 JSON_HB {
}
explain extended select * from t1_json where a between 'a-3a' and 'zzzzzzzzz';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
60
.87 Using where
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
59
.87 Using where
Warnings:
Note 1003 select `test`.`t1_json`.`a` AS `a` from `test`.`t1_json` where `test`.`t1_json`.`a` between 'a-3a' and 'zzzzzzzzz'
analyze select * from t1_json where a between 'a-3a' and 'zzzzzzzzz';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 10.00
60
.87 60.00 Using where
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 10.00
59
.87 60.00 Using where
explain extended select * from t1_json where a < 'b-1a';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
100
.00 Using where
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
99
.00 Using where
Warnings:
Note 1003 select `test`.`t1_json`.`a` AS `a` from `test`.`t1_json` where `test`.`t1_json`.`a` < 'b-1a'
analyze select * from t1_json where a > 'zzzzzzzzz';
...
...
@@ -2476,12 +2476,12 @@ test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
explain extended select * from t2 where city = 'Moscow';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 101 9
8.04
Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 101 9
6.08
Using where
Warnings:
Note 1003 select `test`.`t2`.`city` AS `city` from `test`.`t2` where `test`.`t2`.`city` = 'Moscow'
analyze select * from t2 where city = 'Moscow';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 101 101.00 9
8.04
98.02 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 101 101.00 9
6.08
98.02 Using where
explain extended select * from t2 where city = 'Helsinki';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 101 2.00 Using where
...
...
sql/sql_statistics.cc
View file @
fcf58a5e
This diff is collapsed.
Click to expand it.
sql/sql_statistics.h
View file @
fcf58a5e
...
...
@@ -400,10 +400,8 @@ class Histogram_json : public Histogram_base
double
avg_selection
)
override
;
double
range_selectivity
(
Field
*
field
,
key_range
*
min_endp
,
key_range
*
max_endp
)
override
;
/*
* Returns the index of the biggest histogram value that is smaller than endpoint
*/
int
find_bucket
(
Field
*
field
,
const
uchar
*
endpoint
);
private:
int
find_bucket
(
Field
*
field
,
const
uchar
*
lookup_val
,
bool
equal_is_less
);
};
class
Columns_statistics
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment