Commit 7cc66487 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Finish exmaples closes[t:1904]

git-svn-id: file:///svn/toku/tokudb@13651 c7de825b-a66e-492c-adef-691d508d4ae1
parent 495bc870
......@@ -5,7 +5,7 @@ CPPFLAGS = -I./include
LDFLAGS = -L.. -lfractaltreeindex -Wl,-rpath,..
db-insert-bdb: db-insert.c
cc -ldb db-insert.c -o db-insert-bdb -DBDB $(CFLAGS)
db-scan-bdb: db-insert.c
db-scan-bdb: db-scan.c
cc -ldb db-scan.c -o db-scan-bdb -DBDB $(CFLAGS)
default: db-insert
......
......@@ -45,4 +45,22 @@ $ ls -lh bench.bdb/
total 322M
-rw-r--r-- 1 bradley bradley 322M 2009-07-28 16:14 bench.db
When scanning the table, one can run out of locks with BDB. There are ways around it (increase the lock table size).
$ ./db-scan-bdb
Lock table is out of available object entries
db-scan-bdb: db-scan.c:177: scanscan_hwc: Assertion `r==(-30988)' failed.
Aborted
TokuDB is fine on a big table scan.
$ ./db-scan
Scan 33162304 bytes (2072644 rows) in 7.924463s at 4.184801MB/s
Scan 33162304 bytes (2072644 rows) in 3.062239s at 10.829431MB/s
0:3 1:53 2:56
miss=3 hit=53 wait_reading=0 wait=0
VmPeak: 244668 kB
VmHWM: 68096 kB
VmRSS: 1232 kB
There isn't much documentation for the Tokutek Fractal Tree index library, but most of the API is like Berkeley DB's.
......@@ -167,10 +167,14 @@ static void scanscan_hwc (void) {
c_get_flags |= lock_flag;
}
while (0 == (r = dbc->c_get(dbc, &k, &v, c_get_flags))) {
//printf("r=%d\n", r);
totalbytes += k.size + v.size;
rowcounter++;
if (limitcount>0 && rowcounter>=limitcount) break;
}
assert(r==DB_NOTFOUND);
r = dbc->c_close(dbc); assert(r==0);
double thistime = gettime();
double tdiff = thistime-prevtime;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment