Update of /cvsroot/monetdb/pathfinder/compiler/include
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2509/compiler/include

Modified Files:
      Tag: Nov2009
        logical.h 
Log Message:
propagated changes of Monday Sep 28 2009 - Wednesday Oct 07 2009
from the Aug2009_NFI branch to the Nov2009 branch

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/09/28 - boncz: compiler/include/logical.h,1.69.6.1
  optimizations for NFI XIRAF use case -- thanks a great bunch Jan R.!!
  
  - ds_link (already in Stable) optimized for 1-node case
  - indices now contain all data (but still not used automatically, nor based 
on Lefteris' new indexing schemes)
  
  most prominently though is: subexpression result caching
  - caching hints in pragmas
  - query enclosed in (# pf:session id:msec ) { query }  or (# pf:session-use 
id:msec ) { query }
    + queries in the same session use the same working set (documents opened 
only once)
    + same working set allows to cache results
    + pf:session-use only uses cache, cannot add to it
      - but, multiple pf:session-use can run concurrently; whereas pf:session 
is exclusive
  - inside a query, an arbitrary number of expressions can be marked up for 
caching/reuse
    + (# pf:cache id ) { subexpr }
    + subexpr may not be enclosed by a for-loop
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/10/06 - boncz: compiler/include/logical.h,1.69.6.2
  enable heuristic rewrite value-selections in the algebra backend of 
MonetDB/xQuery
  
  has to properly implement pf:attribute(ctx, node, ns1, loc1, ns2, loc2) first,
  as only the verion without namespaces was there (that one is now gone).
  
  many restrictions:
  - only non-loop-lifted equality tests
  - not involving fn:collection or pf:collection (as path reversal in the 
latter will never find the supernode)
  - not involving any date/time/etc typed expressions (as the indices only work 
for string and numerical equality)
  
  went through the testweb and fixed all apparant problems
  
  note the Aug2009_NFI value indices are full; whereas previously they would 
omit frequent data items
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


U logical.h
Index: logical.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/logical.h,v
retrieving revision 1.69
retrieving revision 1.69.4.1
diff -u -d -r1.69 -r1.69.4.1
--- logical.h   12 Jun 2009 13:06:16 -0000      1.69
+++ logical.h   7 Oct 2009 13:47:04 -0000       1.69.4.1
@@ -148,8 +148,9 @@
                                    union of fragments */
     , la_empty_frag      = 74 /**< representation of an empty fragment */
 
-    , la_error           = 79 /**< facility to trigger runtime errors */
-    , la_nil             = 80 /**< end of the list of parameters */
+    , la_error           = 78 /**< facility to trigger runtime errors */
+    , la_nil             = 79 /**< end of the list of parameters */
+    , la_cache           = 80 /**< cache operator */
     , la_trace           = 81 /**< debug operator */
     , la_trace_items     = 82 /**< debug items operator */
     , la_trace_msg       = 83 /**< debug message operator */
@@ -364,6 +365,7 @@
         PFalg_col_t     item_res; /**< column to store the resulting nodes */
         PFalg_col_t     item;     /**< column to look up the context nodes */
         PFalg_col_t     item_doc; /**< column to store the fragment info */
+        const char      *ns1, *loc1, *ns2, *loc2;
     } doc_join;
 
     /* store the column names necessary for document or collection lookup */
@@ -426,6 +428,13 @@
         PFalg_col_t     col;      /**< column of error message */
     } err;
 
+    /* semantic content for cache operator */
+    struct {
+        char *          id;       /**< the cache id */
+        PFalg_col_t     pos;      /**< position column */
+        PFalg_col_t     item;     /**< item column */
+    } cache;
+
     /* semantic content for debug relation map operator */
     struct {
         PFalg_col_t     inner;    /**< name of the inner column */
@@ -577,8 +586,9 @@
  * or below a `rec_fix' operator if the side effects appear in the recursion
  * body.
  * The `side_effects' operator contains a (possibly empty) list of operations
- * that may trigger side effects (operators `error' and `trace') in its left
- * child and the fragment or recursion parameters in the right child.
+ * that may trigger side effects (operators `error', `cache' and `trace')
+ * in its left child and the fragment or recursion parameters in the right
+ * child.
  */
 PFla_op_t * PFla_side_effects (const PFla_op_t *side_effects,
                                const PFla_op_t *params);
@@ -937,7 +947,9 @@
 PFla_op_t * PFla_doc_index_join (const PFla_op_t *doc, const PFla_op_t *n,
                                  PFla_doc_join_kind_t kind,
                                  PFalg_col_t item,
-                                 PFalg_col_t item_res, PFalg_col_t item_doc);
+                                 PFalg_col_t item_res, PFalg_col_t item_doc,
+                                 const char *ns1, const char *loc1,
+                                 const char *ns2, const char *loc2);
 
 /*********** node construction functionality *************/
 
@@ -1134,6 +1146,15 @@
 PFla_op_t *PFla_nil (void);
 
 /**
+ * Constructor for a caching operator
+ */
+PFla_op_t *PFla_cache (const PFla_op_t *n1,
+                       const PFla_op_t *n2,
+                       char *id,
+                       PFalg_col_t pos,
+                       PFalg_col_t item);
+
+/**
  * Constructor for debug operator
  */
 PFla_op_t * PFla_trace (const PFla_op_t *n1,


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to