Changeset: 69fad3e6c5b8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/69fad3e6c5b8
Modified Files:
gdk/gdk_bat.c
sql/storage/bat/bat_storage.c
Branch: Dec2025
Log Message:
Slight change in COLcopy: if writable is false and role==PERSISTENT, use slow
copy of BUNs.
This version of COLcopy is now only called by the sys.vacuum
implementation, ensuring that vheaps are reduced in size if rows had
been deleted.
diffs (38 lines):
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -731,6 +731,13 @@ COLcopy2(BAT *b, int tt, bool writable,
* offset heap is only (less than) half the size
* of the parent's offset heap */
slowcopy = true;
+ } else if (bi.vh && role == PERSISTENT && !writable) {
+ /* writable usually means no view, but
+ * role==PERSISTENT already implies that, so we
+ * use it to decide whether we can do a faster
+ * memcpy (if true) or must do a slower
+ * individual insert (if false) */
+ slowcopy = true;
}
}
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
@@ -5078,7 +5078,7 @@ vacuum_col(sql_trans *tr, sql_column *c,
BAT *b = NULL, *bn = NULL;;
if ((b = bind_col(tr, c, 0)) == NULL)
return LOG_ERR;
- if ((bn = COLcopy(b, b->ttype, true, PERSISTENT)) == NULL) {
+ if ((bn = COLcopy(b, b->ttype, false, PERSISTENT)) == NULL) {
BBPreclaim(b);
return LOG_ERR;
}
@@ -5117,7 +5117,7 @@ vacuum_tab(sql_trans *tr, sql_table *t,
BAT *b = NULL, *bn = NULL;;
if ((b = bind_col(tr, c, 0)) == NULL)
return LOG_ERR;
- if ((bn = COLcopy(b, b->ttype, true, PERSISTENT)) == NULL) {
+ if ((bn = COLcopy(b, b->ttype, false, PERSISTENT)) == NULL) {
BBPreclaim(b);
return LOG_ERR;
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]