Update of /cvsroot/monetdb/sql/src/storage/bat
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13805/src/storage/bat

Modified Files:
        bat_storage.mx 
Log Message:
for smaller updates we prefer the log over snapshots
also removed a bogus BATcommit (when copying inserted data of the 
current transaction we should not jet commit it)


Index: bat_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bat/bat_storage.mx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- bat_storage.mx      16 Nov 2007 20:31:05 -0000      1.9
+++ bat_storage.mx      23 Dec 2007 21:14:17 -0000      1.10
@@ -70,7 +70,6 @@
 
        BATseqbase(c, ibase );
        c->batDirty |= 2;
-       BATcommit(c);
        r = temp_create(c);
        bat_destroy(c);
        bat_destroy(o);
@@ -882,20 +881,18 @@
                                append_inserted(ci, ins);
                                bat_destroy(ci);
                        }
-                       if (ok == LOG_OK && tr->parent == gtrans && 
-                               (store_nr_active != 1 || BATcount(cur)))
+                       if (ok == LOG_OK && tr->parent == gtrans && 
(store_nr_active != 1 || BATcount(cur) || BATcount(ins) <= 1000))
                                ok = log_bat(bat_logger, ins, obat->name);
                }
                if (store_nr_active == 1) { /* flush all */
                        BAT *pi = temp_descriptor(obat->ibid);
-                       if (!BATcount(cur)) {
+                       if (!BATcount(cur) && BATcount(ins) > 1000) {
                                /* swap cur and ins */
                                BAT *swpbat = ins;
-                               bat swp = cbat->ibid;
-                               cbat->ibid = obat->bid;
-                               obat->bid = swp;
+
+                               temp_destroy(obat->bid);
                                temp_destroy(cbat->bid);
-                               cbat->bid = temp_create(swpbat);
+                               obat->bid = cbat->bid = temp_create(swpbat);
                                if (tr->parent == gtrans) {
                                        BATmode(ins, PERSISTENT);
                                        if (BATcount(ins) > (size_t) 
REMAP_PAGE_MAXSIZE)
@@ -903,7 +900,9 @@
                                        logger_add_bat(bat_logger, ins, 
obat->name);
                                        log_bat_persists(bat_logger, ins, 
obat->name);
                                }
-                               ins = cur;
+                               cbat->ibid = e_bat(cur->ttype);
+                               ins = temp_descriptor(cbat->ibid);
+                               bat_destroy(cur);
                                cur = swpbat;
                        } else {
                                if (BATcount(cur)+BATcount(ins) > (size_t) 
REMAP_PAGE_MAXSIZE) { /* try to use mmap() */


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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

Reply via email to