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
9bba5955
Commit
9bba5955
authored
Jul 29, 2021
by
Michael Okoko
Committed by
Sergei Petrunia
Jan 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unneeded shared methods
Signed-off-by:
Michael Okoko
<
okokomichaels@outlook.com
>
parent
1fa7af74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
sql/sql_statistics.cc
sql/sql_statistics.cc
+7
-6
sql/sql_statistics.h
sql/sql_statistics.h
+2
-11
No files found.
sql/sql_statistics.cc
View file @
9bba5955
...
...
@@ -1086,7 +1086,7 @@ class Column_stat: public Stat_table
// Note: this is dumb. the histogram size is stored with the
// histogram!
stat_field
->
store
(
stats
->
histogram_
?
stats
->
histogram_
->
get_
size
()
:
0
);
stats
->
histogram_
->
get_
width
()
:
0
);
break
;
case
COLUMN_STAT_HIST_TYPE
:
if
(
stats
->
histogram_
)
...
...
@@ -1256,7 +1256,6 @@ bool Histogram_binary::parse(MEM_ROOT *mem_root, Histogram_type type_arg, const
return
false
;
}
/*
Save the histogram data info a table field.
*/
...
...
@@ -1268,7 +1267,7 @@ void Histogram_binary::serialize(Field *field)
&
my_charset_bin
);
}
else
field
->
store
((
char
*
)
get_values
(),
get_
size
(),
&
my_charset_bin
);
field
->
store
((
char
*
)
get_values
(),
get_
width
(),
&
my_charset_bin
);
}
void
Histogram_binary
::
init_for_collection
(
MEM_ROOT
*
mem_root
,
...
...
@@ -1287,6 +1286,7 @@ void Histogram_json::init_for_collection(MEM_ROOT *mem_root, Histogram_type htyp
values
=
(
uchar
*
)
alloc_root
(
mem_root
,
size_arg
);
size
=
(
uint8
)
size_arg
;
}
/*
An object of the class Index_stat is created to read statistical
data on tables from the statistical table table_stat, to update
...
...
@@ -2641,18 +2641,19 @@ bool Column_statistics_collected::add()
/*
Create an empty Histogram
_binary
object from histogram_type.
Create an empty Histogram object from histogram_type.
Note: it is not yet clear whether collection-time histogram should be the same
as lookup-time histogram. At the moment, they are.
*/
Histogram_b
inary
*
get_histogram_by_type
(
MEM_ROOT
*
mem_root
,
Histogram_type
hist_type
)
{
Histogram_b
ase
*
get_histogram_by_type
(
MEM_ROOT
*
mem_root
,
Histogram_type
hist_type
)
{
switch
(
hist_type
)
{
case
SINGLE_PREC_HB
:
case
DOUBLE_PREC_HB
:
case
JSON
:
return
new
Histogram_binary
();
case
JSON
:
return
new
Histogram_json
();
default:
DBUG_ASSERT
(
0
);
}
...
...
sql/sql_statistics.h
View file @
9bba5955
...
...
@@ -171,11 +171,6 @@ class Histogram_base : public Sql_alloc
virtual
double
range_selectivity
(
double
min_pos
,
double
max_pos
)
=
0
;
virtual
double
point_selectivity
(
double
pos
,
double
avg_selection
)
=
0
;
// Legacy: return the size of the histogram on disk.
// This will be stored in mysql.column_stats.hist_size column.
// Newer, JSON-based histograms may return 0.
virtual
uint
get_size
()
=
0
;
virtual
~
Histogram_base
(){}
};
...
...
@@ -189,8 +184,6 @@ class Histogram_binary : public Histogram_base
Histogram_type
get_type
()
override
{
return
type
;
}
uint
get_size
()
override
{
return
(
uint
)
size
;
}
uint
get_width
()
override
{
switch
(
type
)
{
...
...
@@ -283,7 +276,7 @@ class Histogram_binary : public Histogram_base
void
set_values
(
uchar
*
vals
)
override
{
values
=
(
uchar
*
)
vals
;
}
void
set_size
(
ulonglong
sz
)
override
{
size
=
(
uint8
)
sz
;
}
bool
is_available
()
override
{
return
get_
size
()
>
0
&&
get_values
();
}
bool
is_available
()
override
{
return
get_
width
()
>
0
&&
get_values
();
}
/*
This function checks that histograms should be usable only when
...
...
@@ -354,8 +347,6 @@ class Histogram_json : public Histogram_base
void
serialize
(
Field
*
to_field
)
override
{}
uint
get_size
()
override
{
return
(
uint
)
size
;}
// returns number of buckets in the histogram
uint
get_width
()
override
{
...
...
@@ -371,7 +362,7 @@ class Histogram_json : public Histogram_base
void
init_for_collection
(
MEM_ROOT
*
mem_root
,
Histogram_type
htype_arg
,
ulonglong
size
)
override
;
bool
is_available
()
override
{
return
get_
size
()
>
0
&&
get_values
();
}
bool
is_available
()
override
{
return
get_
width
()
>
0
&&
get_values
();
}
bool
is_usable
(
THD
*
thd
)
override
{
...
...
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