Changeset: ea03f4b79bed for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea03f4b79bed
Modified Files:
monetdb5/modules/atoms/mtime.c
sql/storage/bat/bat_storage.c
Branch: Jul2015
Log Message:
only flush dirty tables to disk
diffs (85 lines):
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -2657,7 +2657,7 @@ MTIMEtimestamp(timestamp *ret, const int
lng l;
str e;
- if (*sec == lng_nil) {
+ if (*sec == int_nil) {
*ret = *timestamp_nil;
return MAL_SUCCEED;
}
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -1735,16 +1735,18 @@ gtr_update_table(sql_trans *tr, sql_tabl
int ok = LOG_OK;
node *n;
+ if (t->base.wtime <= t->base.allocated)
+ return ok;
gtr_update_dbat(t->data, tchanges);
for (n = t->columns.set->h; ok == LOG_OK && n; n = n->next) {
int changes = 0;
sql_column *c = n->data;
- if (!c->base.wtime)
+ if (!c->base.wtime || c->base.wtime <= c->base.allocated)
continue;
ok = gtr_update_delta(tr, c->data, &changes);
if (changes)
- c->base.wtime = tr->wstime;
+ c->base.allocated = c->base.wtime = tr->wstime;
(*tchanges) |= changes;
}
if (ok == LOG_OK && t->idxs.set) {
@@ -1753,17 +1755,17 @@ gtr_update_table(sql_trans *tr, sql_tabl
sql_idx *ci = n->data;
/* some indices have no bats */
- if (!ci->base.wtime)
+ if (!ci->base.wtime || ci->base.wtime <=
ci->base.allocated)
continue;
ok = gtr_update_delta(tr, ci->data, &changes);
if (changes)
- ci->base.wtime = tr->wstime;
+ ci->base.allocated = ci->base.wtime =
tr->wstime;
(*tchanges) |= changes;
}
}
if (*tchanges)
- t->base.wtime = tr->wstime;
+ t->base.allocated = t->base.wtime = tr->wstime;
return ok;
}
@@ -1779,6 +1781,11 @@ static int
int schanges = 0;
sql_schema *s = sn->data;
+ if (s->base.wtime <= s->base.allocated &&
+ gtr_update_table_f == gtr_update_table)
+ continue;
+ if (!s->base.wtime)
+ continue;
if (!isTempSchema(s) && s->tables.set) {
node *n;
for (n = s->tables.set->h; n && ok == LOG_OK; n =
n->next) {
@@ -1790,12 +1797,12 @@ static int
schanges |= changes;
}
}
- if (schanges){
- s->base.wtime = tr->wstime;
+ if (schanges && gtr_update_table_f == gtr_update_table){
+ s->base.allocated = s->base.wtime = tr->wstime;
tchanges ++;
}
}
- if (tchanges)
+ if (tchanges && gtr_update_table_f == gtr_update_table)
tr->wtime = tr->wstime;
return LOG_OK;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list