Changeset: c3e306ad455c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c3e306ad455c
Modified Files:
        gdk/gdk_bbp.c
Branch: properties
Log Message:

Read and cache min/max values when type and position is known during startup.


diffs (32 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -991,6 +991,28 @@ BBPreadEntries(FILE *fp, unsigned bbpver
                BBP_lrefs(bid) = 1;     /* any BAT we encounter here is 
persistent, so has a logical reference */
                BBP_desc(bid) = bn;
                BBP_status(bid) = BBPEXISTING;  /* do we need other status 
bits? */
+               bool loaded = false;
+               PROPrec *p;
+               if (bn->ttype >= 0 && (p = BATgetprop(bn, GDK_MIN_POS)) != 
NULL) {
+                       /* for known types cache the value corresponding to the
+                        * position */
+                       if ((bn = BATdescriptor(bn->batCacheid)) != NULL) {
+                               loaded = true;
+                               BATiter bi = bat_iterator(bn);
+                               BATsetprop(bn, GDK_MIN_VALUE, bn->ttype, 
BUNtail(bi, p->v.val.oval));
+                       }
+               }
+               if (bn->ttype >= 0 && (p = BATgetprop(bn, GDK_MAX_POS)) != 
NULL) {
+                       /* for known types cache the value corresponding to the
+                        * position */
+                       if (loaded || (bn = BATdescriptor(bn->batCacheid)) != 
NULL) {
+                               loaded = true;
+                               BATiter bi = bat_iterator(bn);
+                               BATsetprop(bn, GDK_MAX_VALUE, bn->ttype, 
BUNtail(bi, p->v.val.oval));
+                       }
+               }
+               if (loaded)
+                       BBPunfix(bn->batCacheid);
        }
        return GDK_SUCCEED;
 }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to