Update of /cvsroot/monetdb/pathfinder/runtime
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31144/runtime

Modified Files:
      Tag: M5XQ
        vx_index.mx 
Log Message:
propagated changes of Monday Jan 04 2010
from the XQFT branch to the M5XQ branch

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2010/01/04 - sjoerd: runtime/vx_index.mx,1.12.12.2
  propagated changes of Monday Jan 04 2010
  from the development trunk to the XQFT branch
  
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2010/01/04 - sjoerd: runtime/vx_index.mx,1.14
    Changed the implementation of the offset heap for type string.
  
    Before, the offset heap would contain values of type var_t (typically
    equal in size to oid), so if there are lots of entries but not that
    many different strings, a lot of space was wasted, since only the
    lower few bytes of the values in the offset heap would be used, the
    rest being zero.
  
    In this version, the offset heap has a dynamic width.  It starts off
    as a single byte value, and when the offsets become too large to fit
    in a single byte, the heap is upgraded to a short, then an int, and
    finally (if the system uses 64 bit oids) to lng.
  
    There are tags to mark this change:
    before_variable_string_offset and after_variable_string_offset.
  
    Only MonetDB* and pathfinder needed to be changes, so the tags are
    only added there.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: vx_index.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/vx_index.mx,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.2
diff -u -d -r1.12.2.1 -r1.12.2.2
--- vx_index.mx 9 Dec 2009 14:26:03 -0000       1.12.2.1
+++ vx_index.mx 4 Jan 2010 15:22:05 -0000       1.12.2.2
@@ -90,7 +90,7 @@
         var_t *src = (var_t*) Tloc(b, BUNfirst(b));
         int *dst = (int*) Tloc(bn, BUNfirst(bn));
         for(i=0; i<cnt; i++)
-            dst[i] =  XQH_H(base + (src[i]<<GDK_VARSHIFT));
+            dst[i] =  XQH_H(base + VarHeapVal(src, i, b->T->width));
 
         ALIGNsetH(bn, b);
         BATsetcount(bn, cnt);
@@ -593,12 +593,12 @@
  * to be only of kind TEXT. This is not true during updates,
  * since there might *not* be a text node (deleted).
  */
-pre_hsh[pre] = XQH_H(text_base + (pre_text[pre_prop[pre]]<<GDK_VARSHIFT));
+pre_hsh[pre] = XQH_H(text_base + VarHeapVal(pre_text, pre_prop[pre], 
text_width));
 cur++;
 
 @= found_update_string
 if (pre_kind[pre] == TEXT) {
-    pre_hsh[pre] = XQH_H(text_base + (pre_text[pre_prop[pre]]<<GDK_VARSHIFT));
+    pre_hsh[pre] = XQH_H(text_base + VarHeapVal(pre_text, pre_prop[pre], 
text_width));
     cur++;
 } else {
     /* deal with non-text nodes */
@@ -609,12 +609,12 @@
  * to be only of kind TEXT. This is not true during updates,
  * since there might *not* be a text node (deleted).
  */
-pre_state[pre] = dbl_fsm(text_base + (pre_text[pre_prop[pre]] << 
GDK_VARSHIFT));
+pre_state[pre] = dbl_fsm(text_base + VarHeapVal(pre_text, pre_prop[pre], 
text_width));
 cur++;
 
 @= found_update_dbl
 if (pre_kind[pre] == TEXT) {
-    pre_state[pre] = dbl_fsm(text_base + (pre_text[pre_prop[pre]] << 
GDK_VARSHIFT));
+    pre_state[pre] = dbl_fsm(text_base + VarHeapVal(pre_text, pre_prop[pre], 
text_width));
     cur++;
 } else {
     /* deal with non-text nodes */
@@ -754,10 +754,11 @@
         @:declerati...@1_@2()@
                                           /* DOCUMENT:                   */
         oid* pre_prop,                    /* - pre_prop column           */
-        var_t* pre_text,                  /* - fixed-size offsets of the
+        void* pre_text,                   /* - fixed-size offsets of the
                                                pre_text string column    */
         char* text_base,                  /* - base pointer of the
                                                pre_text string heap      */
+        unsigned short text_width,        /* - width of pre_text column  */
         unsigned int* pre_size,           /* - pre_size column           */
         unsigned char* pre_level,         /* - pre_level column          */
         unsigned char* pre_kind,          /* - pre_kind column           */
@@ -914,6 +915,7 @@
                     pre_prop,
                     (var_t*) Tloc(prop_text, BUNfirst(prop_text)),
                     (char*) prop_text->T->vheap->base,
+                    prop_text->T->width,
                     pre_size, pre_level, pre_kind, limit,
                     context, BATcount(ctx_bat))) {
             status = GDK_SUCCEED;
@@ -1006,6 +1008,7 @@
                 pre_prop,
                 (var_t*) Tloc(prop_text, BUNfirst(prop_text)),
                 (char*) prop_text->T->vheap->base,
+                prop_text->T->width,
                 pre_size, pre_level, pre_kind, limit,
                 context, BATcount(ctx_bat))) {
         status = GDK_SUCCEED;


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to