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
251fb37b
Commit
251fb37b
authored
Aug 09, 2001
by
tim@work.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge work.mysql.com:/home/bk/mysql into work.mysql.com:/home/tim/my/3
parents
bbb40f5b
fe9b9784
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3802 additions
and
3545 deletions
+3802
-3545
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+2
-0
Docs/manual.texi
Docs/manual.texi
+3752
-3540
innobase/btr/btr0cur.c
innobase/btr/btr0cur.c
+11
-0
sql/ha_innobase.cc
sql/ha_innobase.cc
+36
-5
sql/ha_innobase.h
sql/ha_innobase.h
+1
-0
No files found.
BitKeeper/etc/logging_ok
View file @
251fb37b
heikki@donna.mysql.fi
jani@hynda.mysql.fi
jani@hynda.mysql.fi
jcole@tetra.spaceapes.com
tim@work.mysql.com
tim@work.mysql.com
Docs/manual.texi
View file @
251fb37b
This diff is collapsed.
Click to expand it.
innobase/btr/btr0cur.c
View file @
251fb37b
...
@@ -2351,6 +2351,7 @@ btr_estimate_n_rows_in_range(
...
@@ -2351,6 +2351,7 @@ btr_estimate_n_rows_in_range(
btr_path_t
*
slot1
;
btr_path_t
*
slot1
;
btr_path_t
*
slot2
;
btr_path_t
*
slot2
;
ibool
diverged
;
ibool
diverged
;
ulint
divergence_level
;
ulint
n_rows
;
ulint
n_rows
;
ulint
i
;
ulint
i
;
mtr_t
mtr
;
mtr_t
mtr
;
...
@@ -2393,6 +2394,7 @@ btr_estimate_n_rows_in_range(
...
@@ -2393,6 +2394,7 @@ btr_estimate_n_rows_in_range(
n_rows
=
1
;
n_rows
=
1
;
diverged
=
FALSE
;
diverged
=
FALSE
;
divergence_level
=
1000000
;
for
(
i
=
0
;
;
i
++
)
{
for
(
i
=
0
;
;
i
++
)
{
ut_ad
(
i
<
BTR_PATH_ARRAY_N_SLOTS
);
ut_ad
(
i
<
BTR_PATH_ARRAY_N_SLOTS
);
...
@@ -2403,6 +2405,13 @@ btr_estimate_n_rows_in_range(
...
@@ -2403,6 +2405,13 @@ btr_estimate_n_rows_in_range(
if
(
slot1
->
nth_rec
==
ULINT_UNDEFINED
if
(
slot1
->
nth_rec
==
ULINT_UNDEFINED
||
slot2
->
nth_rec
==
ULINT_UNDEFINED
)
{
||
slot2
->
nth_rec
==
ULINT_UNDEFINED
)
{
if
(
i
>
divergence_level
+
1
)
{
/* In trees whose height is > 1 our algorithm
tends to underestimate: multiply the estimate
by 2: */
n_rows
=
n_rows
*
2
;
}
return
(
n_rows
);
return
(
n_rows
);
}
}
...
@@ -2417,6 +2426,8 @@ btr_estimate_n_rows_in_range(
...
@@ -2417,6 +2426,8 @@ btr_estimate_n_rows_in_range(
return
(
10
);
return
(
10
);
}
}
divergence_level
=
i
;
diverged
=
TRUE
;
diverged
=
TRUE
;
}
else
if
(
diverged
)
{
}
else
if
(
diverged
)
{
n_rows
=
(
n_rows
*
(
slot1
->
n_recs
+
slot2
->
n_recs
))
n_rows
=
(
n_rows
*
(
slot1
->
n_recs
+
slot2
->
n_recs
))
...
...
sql/ha_innobase.cc
View file @
251fb37b
...
@@ -822,11 +822,11 @@ ha_innobase::open(
...
@@ -822,11 +822,11 @@ ha_innobase::open(
if
(
NULL
==
(
ib_table
=
dict_table_get
(
norm_name
,
NULL
)))
{
if
(
NULL
==
(
ib_table
=
dict_table_get
(
norm_name
,
NULL
)))
{
fprintf
(
stderr
,
"\
fprintf
(
stderr
,
Cannot find table %s from the internal data dictionary
\n
\
"Cannot find table %s from the internal data dictionary
\n
"
of InnoDB though the .frm file for the table exists. Maybe you have deleted
\n
\
"of InnoDB though the .frm file for the table exists. Maybe you have deleted
\n
"
and created again an InnoDB database but forgotten to delete the
\n
\
"and created again an InnoDB database but forgotten to delete the
\n
"
corresponding .frm files of old InnoDB tables?
\n
"
,
"
corresponding .frm files of old InnoDB tables?
\n
"
,
norm_name
);
norm_name
);
free_share
(
share
);
free_share
(
share
);
...
@@ -2659,6 +2659,37 @@ ha_innobase::records_in_range(
...
@@ -2659,6 +2659,37 @@ ha_innobase::records_in_range(
DBUG_RETURN
((
ha_rows
)
n_rows
);
DBUG_RETURN
((
ha_rows
)
n_rows
);
}
}
/*************************************************************************
Gives an UPPER BOUND to the number of rows in a table. This is used in
filesort.cc and the upper bound must hold. TODO: Since the number of
rows in a table may change after this function is called, we still may
get a 'Sort aborted' error in filesort.cc of MySQL. The ultimate fix is to
improve the algorithm of filesort.cc. */
ha_rows
ha_innobase
::
estimate_number_of_rows
(
void
)
/*======================================*/
/* out: upper bound of rows, currently 32-bit int
or uint */
{
row_prebuilt_t
*
prebuilt
=
(
row_prebuilt_t
*
)
innobase_prebuilt
;
dict_table_t
*
ib_table
;
DBUG_ENTER
(
"info"
);
ib_table
=
prebuilt
->
table
;
dict_update_statistics
(
ib_table
);
data_file_length
=
((
ulonglong
)
ib_table
->
stat_clustered_index_size
)
*
UNIV_PAGE_SIZE
;
/* The minimum clustered index record size is 20 bytes */
return
((
ha_rows
)
(
1000
+
data_file_length
/
20
));
}
/*************************************************************************
/*************************************************************************
How many seeks it will take to read through the table. This is to be
How many seeks it will take to read through the table. This is to be
comparable to the number returned by records_in_range so that we can
comparable to the number returned by records_in_range so that we can
...
...
sql/ha_innobase.h
View file @
251fb37b
...
@@ -137,6 +137,7 @@ class ha_innobase: public handler
...
@@ -137,6 +137,7 @@ class ha_innobase: public handler
enum
ha_rkey_function
start_search_flag
,
enum
ha_rkey_function
start_search_flag
,
const
byte
*
end_key
,
uint
end_key_len
,
const
byte
*
end_key
,
uint
end_key_len
,
enum
ha_rkey_function
end_search_flag
);
enum
ha_rkey_function
end_search_flag
);
ha_rows
estimate_number_of_rows
();
int
create
(
const
char
*
name
,
register
TABLE
*
form
,
int
create
(
const
char
*
name
,
register
TABLE
*
form
,
HA_CREATE_INFO
*
create_info
);
HA_CREATE_INFO
*
create_info
);
...
...
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