Changeset: b21982b39809 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b21982b39809
Modified Files:
        gdk/gdk.h
        gdk/gdk_align.c
        gdk/gdk_bat.c
        gdk/gdk_orderindex.c
        monetdb5/modules/mal/orderidx.mal
Branch: leftmart
Log Message:

Order idx struct does not need to be a pointer


diffs (123 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -796,13 +796,13 @@ gdk_export int VALisnil(const ValRecord 
  *           bit    hsorted;          // are head values currently ordered?
  *           bit    hvarsized;        // for speed: head type is varsized?
  *           bit    hnonil;           // head has no nils
- *           oid    halign;          // alignment OID for head.
+ *           oid    halign;           // alignment OID for head.
  *           // Head storage
  *           int    hloc;             // byte-offset in BUN for head elements
  *           Heap   *hheap;           // heap for varsized head values
  *           Hash   *hhash;           // linear chained hash table on head
  *           Imprints *himprints;     // column imprints index on head
- *           OrderIdx    *horderidx;  // order oid index on head
+ *           OrderIdx horderidx;      // order oid index on head
  *           // Tail properties
  *           int    ttype;            // Tail type number
  *           str    tident;           // name for tail column
@@ -816,7 +816,7 @@ gdk_export int VALisnil(const ValRecord 
  *           Heap   *theap;           // heap for varsized tail values
  *           Hash   *thash;           // linear chained hash table on tail
  *           Imprints *timprints;     // column imprints index on tail
- *           OrderIdx *torderidx;     // order oid index on tail
+ *           OrderIdx torderidx;      // order oid index on tail
  *  } BAT;
  * @end verbatim
  *
@@ -896,7 +896,7 @@ typedef struct {
        Heap *vheap;            /* space for the varsized data. */
        Hash *hash;             /* hash table */
        Imprints *imprints;     /* column imprints index */
-       OrderIdx *orderidx;     /* order oid index */
+       OrderIdx orderidx;      /* order oid index */
 
        PROPrec *props;         /* list of dynamic properties stored in the bat 
descriptor */
 } COLrec;
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -331,8 +331,8 @@ VIEWcreate_(BAT *h, BAT *t, int slice_vi
        bn->T->imprints = NULL;
        /* Order OID index */
        /* TODO: what is the correct step here? slice the OID index? */
-       bn->H->orderidx = NULL;
-       bn->T->orderidx = NULL;
+       bn->H->orderidx.flags = 0;
+       bn->T->orderidx.flags = 0;
        BBPcacheit(bs, 1);      /* enter in BBP */
        /* View of VIEW combine, ie we need to fix the head of the mirror */
        if (vc) {
@@ -548,13 +548,6 @@ VIEWunlink(BAT *b)
                        b->H->imprints = NULL;
                if (tpb && b->T->imprints && b->T->imprints == tpb->H->imprints)
                        b->T->imprints = NULL;
-
-               /* unlink order OID index */
-               if (hpb && b->H->orderidx && b->H->orderidx == hpb->H->orderidx)
-                       b->H->orderidx = NULL;
-               if (tpb && b->T->orderidx && b->T->orderidx == tpb->H->orderidx)
-                       b->T->orderidx = NULL;
-
        }
 }
 
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -127,7 +127,7 @@ BATcreatedesc(int ht, int tt, int heapna
        /*
         * Default zero flags for order oid index
         */
-       bn->torderidx->flags = 0;
+       bn->torderidx.flags = 0;
        /*
         * fill in heap names, so HEAPallocs can resort to disk for
         * very large writes.
diff --git a/gdk/gdk_orderindex.c b/gdk/gdk_orderindex.c
--- a/gdk/gdk_orderindex.c
+++ b/gdk/gdk_orderindex.c
@@ -67,10 +67,10 @@ ORDERkeepidx(BAT *b, BAT *order) {
        }
 
        MT_lock_set(&GDKorderIdxLock(abs(b->batCacheid)), "ORDERkeepidx");
-       if (!b->torderidx->flags) {
-               b->torderidx->o = BBPcacheid(order);
+       if (!b->torderidx.flags) {
+               b->torderidx.o = BBPcacheid(order);
                BBPkeepref(order->batCacheid);
-               b->torderidx->flags = 1;
+               b->torderidx.flags = 1;
        } else {
                /* take care if other index already exists, should not happen 
though
                 * because it is a waste of resources.
@@ -86,8 +86,8 @@ gdk_export
 BAT *ORDERgetidx(BAT *b) {
        BATcheck(b, "ORDERgetidx", GDK_FAIL);
 
-       if (b->torderidx->flags) {
-               return BBPdescriptor(b->torderidx->o);
+       if (b->torderidx.flags) {
+               return BBPdescriptor(b->torderidx.o);
        }
        return NULL;
 }
diff --git a/monetdb5/modules/mal/orderidx.mal 
b/monetdb5/modules/mal/orderidx.mal
--- a/monetdb5/modules/mal/orderidx.mal
+++ b/monetdb5/modules/mal/orderidx.mal
@@ -2,7 +2,7 @@ pattern bat.arrange(bv:bat[:oid,:any_1])
 address ARNGcreate
 comment "Introduces the OID index arrangement of ordered values";
 
-pattern bat.arrange(bv:bat[:oid,:any_1], pieces:int):bat[:oid,:oid]
+pattern bat.arrange(bv:bat[:oid,:any_1], pieces:int):void
 address ARNGcreate
 comment "Introduces the OID index arrangement of ordered values";
 
@@ -13,4 +13,4 @@ comment "Consolidates the OID index arra
 function algebra.arrangeorder(bv:bat[:oid,:any_1], reverse:bit, stable:bit 
):bat[:oid,:oid];
        (v,o):= algebra.subsort(bv,reverse,stable);
        return sortorder:= o;
-end sortorder;
+end arrangeorder;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to