Update of /cvsroot/monetdb/sql/src/storage/bat
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3898/src/storage/bat
Modified Files:
bat_storage.mx
Log Message:
we switch back to the 'preloaded' set of empty bats on commits
switch to mmap also within a multi statement transaction.
U bat_storage.mx
Index: bat_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/bat_storage.mx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- bat_storage.mx 14 May 2008 20:18:29 -0000 1.15
+++ bat_storage.mx 23 May 2008 08:02:38 -0000 1.16
@@ -332,6 +332,9 @@
BATseqbase(i, bat->ibase);
i->batDirty |= 2;
} else if (!isEbat(b)){
+ if (BATcount(b)+BATcount(i) > (size_t) REMAP_PAGE_MAXSIZE) { /*
try to use mmap() */
+ BATmmap(b, STORE_MMAP, STORE_MMAP, STORE_MMAP,
STORE_MMAP);
+ }
BATappend(b, i, TRUE);
} else {
temp_destroy(bat->ibid);
@@ -885,11 +888,11 @@
BAT *pi = temp_descriptor(obat->ibid);
if (!BATcount(cur) && BATcount(ins) > 1000) {
/* swap cur and ins */
- BAT *swpbat = ins;
+ BAT *newcur = ins;
temp_destroy(obat->bid);
temp_destroy(cbat->bid);
- obat->bid = cbat->bid = temp_create(swpbat);
+ obat->bid = cbat->bid = temp_create(newcur);
if (tr->parent == gtrans) {
BATmode(ins, PERSISTENT);
if (BATcount(ins) > (size_t)
REMAP_PAGE_MAXSIZE)
@@ -900,21 +903,22 @@
cbat->ibid = e_bat(cur->ttype);
ins = temp_descriptor(cbat->ibid);
bat_destroy(cur);
- cur = swpbat;
+ cur = newcur;
} else {
if (BATcount(cur)+BATcount(ins) > (size_t)
REMAP_PAGE_MAXSIZE) { /* try to use mmap() */
BATmmap(cur, STORE_MMAP,
STORE_MMAP, STORE_MMAP, STORE_MMAP);
}
BATappend(cur,ins,TRUE);
- bat_clear(ins);
+ temp_destroy(cbat->ibid);
+ cbat->ibid = e_bat(cur->ttype);
}
bat_clear(pi);
obat->ibase = cbat->ibase = BATcount(cur);
- BATseqbase(ins, obat->ibase);
BATseqbase(pi, obat->ibase);
bat_destroy(pi);
+ } else {
+ BATcommit(ins);
}
- BATcommit(ins);
}
bat_destroy(ins);
@@ -940,8 +944,9 @@
bat_destroy(cu);
}
bat_clear(ups);
+ } else {
+ BATcommit(ups);
}
- BATcommit(ups);
}
*cnt = BATcount(cur);
bat_destroy(ups);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins