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
ae2a011b
Commit
ae2a011b
authored
May 01, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#232 fix indexer progress callback to estimate number of rows with stat64
parent
387bfff4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
34 deletions
+9
-34
src/indexer.cc
src/indexer.cc
+9
-34
No files found.
src/indexer.cc
View file @
ae2a011b
...
...
@@ -699,44 +699,19 @@ abort_indexer(DB_INDEXER *indexer) {
// derived from ha_tokudb::estimate_num_rows
static
int
update_estimated_rows
(
DB_INDEXER
*
indexer
)
{
DBT
key
;
toku_init_dbt
(
&
key
);
DBT
data
;
toku_init_dbt
(
&
data
);
DBC
*
crsr
=
NULL
;
DB_TXN
*
txn
=
NULL
;
uint64_t
less
,
equal
,
greater
;
int
is_exact
;
int
error
;
DB
*
db
=
indexer
->
i
->
src_db
;
DB
_TXN
*
txn
=
NULL
;
DB_ENV
*
db_env
=
indexer
->
i
->
env
;
error
=
db_env
->
txn_begin
(
db_env
,
0
,
&
txn
,
DB_READ_UNCOMMITTED
);
if
(
error
)
goto
cleanup
;
error
=
db
->
cursor
(
db
,
txn
,
&
crsr
,
0
);
if
(
error
)
{
goto
cleanup
;
}
error
=
crsr
->
c_get
(
crsr
,
&
key
,
&
data
,
DB_FIRST
);
if
(
error
==
DB_NOTFOUND
)
{
indexer
->
i
->
estimated_rows
=
0
;
error
=
0
;
goto
cleanup
;
}
else
if
(
error
)
{
goto
cleanup
;
}
error
=
db
->
key_range64
(
db
,
txn
,
&
key
,
&
less
,
&
equal
,
&
greater
,
&
is_exact
);
if
(
error
)
{
goto
cleanup
;
}
indexer
->
i
->
estimated_rows
=
equal
+
greater
;
error
=
0
;
cleanup:
if
(
crsr
!=
NULL
)
{
int
rr
=
crsr
->
c_close
(
crsr
);
invariant
(
rr
==
0
);
crsr
=
NULL
;
if
(
error
==
0
)
{
DB_BTREE_STAT64
stats
;
DB
*
db
=
indexer
->
i
->
src_db
;
error
=
db
->
stat64
(
db
,
txn
,
&
stats
);
if
(
error
==
0
)
{
indexer
->
i
->
estimated_rows
=
stats
.
bt_ndata
;
}
txn
->
commit
(
txn
,
0
);
}
txn
->
commit
(
txn
,
0
);
return
error
;
}
...
...
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