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
e540f38d
Commit
e540f38d
authored
Jul 28, 2009
by
Bradley C. Kuszmaul
Committed by
Yoni Fogel
Apr 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more db-scan. [t:1904]
git-svn-id:
file:///svn/toku/tokudb@13647
c7de825b-a66e-492c-adef-691d508d4ae1
parent
a66c379f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
release/examples/db-insert/Makefile
release/examples/db-insert/Makefile
+1
-1
release/examples/db-scan/db-scan.c
release/examples/db-scan/db-scan.c
+8
-13
No files found.
release/examples/db-insert/Makefile
View file @
e540f38d
...
...
@@ -6,4 +6,4 @@ db-insert-bdb: db-insert.c
default
:
db-insert
clean
:
rm
-rf
db-insert
bench.
$(DIRSUF)
rm
-rf
db-insert
db-insert-bdb
release/examples/db-scan/db-scan.c
View file @
e540f38d
...
...
@@ -2,12 +2,18 @@
#define DONT_DEPRECATE_MALLOC
#include <inttypes.h>
#ifdef BDB
#include <db.h>
#define DIRSUF bdb
#else
#include <tokudb.h>
#define DIRSUF tokudb
#endif
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
...
...
@@ -18,7 +24,6 @@ int do_txns=1, prelock=0, prelockflag=0;
u_int32_t
lock_flag
=
0
;
long
limitcount
=-
1
;
u_int32_t
cachesize
=
127
*
1024
*
1024
;
static
int
do_mysql
=
0
;
static
u_int64_t
start_range
=
0
,
end_range
=
0
;
static
int
n_experiments
=
2
;
...
...
@@ -33,7 +38,6 @@ static int print_usage (const char *argv0) {
fprintf
(
stderr
,
" --nox no transactions (no locking)
\n
"
);
fprintf
(
stderr
,
" --count <count> read the first COUNT rows and then stop.
\n
"
);
fprintf
(
stderr
,
" --cachesize <n> set the env cachesize to <n>
\n
"
);
fprintf
(
stderr
,
" --mysql compare keys that are mysql big int not null types
\n
"
);
fprintf
(
stderr
,
" --env DIR put db files in DIR instead of default
\n
"
);
return
1
;
}
...
...
@@ -44,7 +48,7 @@ DB_TXN *tid=0;
#define STRINGIFY2(s) #s
#define STRINGIFY(s) STRINGIFY2(s)
const
char
*
dbdir
=
"./bench."
STRINGIFY
(
DIRSUF
);
/* DIRSUF is passed in as a -D argument to the compiler. */
const
char
*
dbdir
=
".
.
/bench."
STRINGIFY
(
DIRSUF
);
/* DIRSUF is passed in as a -D argument to the compiler. */
int
env_open_flags_yesx
=
DB_CREATE
|
DB_PRIVATE
|
DB_INIT_MPOOL
|
DB_INIT_TXN
|
DB_INIT_LOG
|
DB_INIT_LOCK
;
int
env_open_flags_nox
=
DB_CREATE
|
DB_PRIVATE
|
DB_INIT_MPOOL
;
char
*
dbfilename
=
"bench.db"
;
...
...
@@ -87,8 +91,6 @@ static void parse_args (int argc, const char *argv[]) {
argc
--
;
argv
++
;
if
(
argc
==
0
)
exit
(
print_usage
(
pname
));
dbdir
=
*
argv
;
}
else
if
(
strcmp
(
*
argv
,
"--mysql"
)
==
0
)
{
do_mysql
=
1
;
}
else
if
(
strcmp
(
*
argv
,
"--range"
)
==
0
&&
argc
>
2
)
{
run_mode
=
RUN_RANGE
;
argc
--
;
argv
++
;
...
...
@@ -187,13 +189,6 @@ static int counttotalbytes (DBT const *key, DBT const *data, void *extrav) {
struct
extra_count
*
e
=
extrav
;
e
->
totalbytes
+=
key
->
size
+
data
->
size
;
e
->
rowcounter
++
;
if
(
do_mysql
&&
0
)
{
static
uint64_t
expect_key
=
0
;
uint64_t
k
=
mysql_get_bigint
((
unsigned
char
*
)
key
->
data
+
1
);
if
(
k
!=
expect_key
)
printf
(
"%s:%d %"
PRIu64
" %"
PRIu64
"
\n
"
,
__FUNCTION__
,
__LINE__
,
k
,
expect_key
);
expect_key
=
k
+
1
;
}
return
0
;
}
...
...
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