Changeset: 44f2d01fcb78 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/44f2d01fcb78
Modified Files:
        sql/storage/bat/bat_storage.c
Branch: Jan2022
Log Message:

Don't retrieve min/max for FOR compressed columns at the moment


diffs (66 lines):

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
@@ -2441,34 +2441,36 @@ min_max_col(sql_trans *tr, sql_column *c
                return 0;
        if (c->min && c->max)
                return 1;
-
-       lock_column(tr->store, c->base.id);
-       if (c->min && c->max) {
+       if ((d = ATOMIC_PTR_GET(&c->data))) {
+               if (d->cs.st == ST_FOR)
+                       return 0;
+               lock_column(tr->store, c->base.id);
+               if (c->min && c->max) {
+                       unlock_column(tr->store, c->base.id);
+                       return 1;
+               }
+               _DELETE(c->min);
+               _DELETE(c->max);
+               if ((b = temp_descriptor(d->cs.st == ST_DICT ? d->cs.ebid : 
d->cs.bid))) {
+                       BATiter bi = bat_iterator(b);
+                       if (bi.minpos != BUN_NONE && bi.maxpos != BUN_NONE) {
+                               void *nmin = BUNtail(bi, bi.minpos), *nmax = 
BUNtail(bi, bi.maxpos);
+                               size_t minlen = ATOMlen(bi.type, nmin), maxlen 
= ATOMlen(bi.type, nmax);
+
+                               if (!(c->min = GDKmalloc(minlen)) || !(c->max = 
GDKmalloc(maxlen))) {
+                                       _DELETE(c->min);
+                                       _DELETE(c->max);
+                               } else {
+                                       memcpy(c->min, nmin, minlen);
+                                       memcpy(c->max, nmax, maxlen);
+                                       ok = 1;
+                               }
+                       }
+                       bat_iterator_end(&bi);
+                       bat_destroy(b);
+               }
                unlock_column(tr->store, c->base.id);
-               return 1;
        }
-       _DELETE(c->min);
-       _DELETE(c->max);
-       if ((d = ATOMIC_PTR_GET(&c->data)) &&
-               (b = temp_descriptor(d->cs.st == ST_DICT ? d->cs.ebid : 
d->cs.bid))) {
-               BATiter bi = bat_iterator(b);
-               if (bi.minpos != BUN_NONE && bi.maxpos != BUN_NONE) {
-                       void *nmin = BUNtail(bi, bi.minpos), *nmax = 
BUNtail(bi, bi.maxpos);
-                       size_t minlen = ATOMlen(bi.type, nmin), maxlen = 
ATOMlen(bi.type, nmax);
-
-                       if (!(c->min = GDKmalloc(minlen)) || !(c->max = 
GDKmalloc(maxlen))) {
-                               _DELETE(c->min);
-                               _DELETE(c->max);
-                       } else {
-                               memcpy(c->min, nmin, minlen);
-                               memcpy(c->max, nmax, maxlen);
-                               ok = 1;
-                       }
-               }
-               bat_iterator_end(&bi);
-               bat_destroy(b);
-       }
-       unlock_column(tr->store, c->base.id);
        return ok;
 }
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to