Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16:/tmp/cvs-serv489/runtime

Modified Files:
        pf_support.mx 
Log Message:

some more pre-kind-test optimizations(?):

- in case a requested pre-test with child/descendant/decendant-or-self
  is not possible (e.g., because there is no suitable index),
  let's at least push-down the kind-test as pre-test,
  and only do ns-/loc-/nsloc-test as post-filter.

- one more place to avoid post-kind-test,
  in case we already did it as pre-kind-test


Declaration/disclaimer:
-----------------------
On my FC6 desktop (64-bit, 64-bit OIDs, configured with --enable-optimize,
compiled with gcc 4.1.1), this check-in does not make any pathfinder test
fail that did not also fail with the most recent code base in CVS prior to
this check-in.
I did not check in detail, though, whether all previously failing tests
still fail the same way after this check-in as they did before this
check-in.


Index: pf_support.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pf_support.mx,v
retrieving revision 1.231
retrieving revision 1.232
diff -u -d -r1.231 -r1.232
--- pf_support.mx       15 May 2007 16:03:11 -0000      1.231
+++ pf_support.mx       15 May 2007 17:14:52 -0000      1.232
@@ -1801,8 +1801,11 @@
 @
 @= postfilter
 if (postfilter) {
+       var pre_kind := nil;
+       if (isnil(kind_test)) {
+           pre_kind := ws.fetch(PRE_KIND).fetch(contID);
+       }
        var pre_cont := ws.fetch(PRE_CONT).fetch(contID);
-       var pre_kind := ws.fetch(PRE_KIND).fetch(contID);
        var pre_prop := ws.fetch(PRE_PROP).fetch(contID);
        if (is_constant(pre_cont)) {
                 # determine a sel [qnid,qnid] of qualifying nslocs (i.e. prop 
IDs)
@@ -1853,7 +1856,7 @@
 @= target_post
         @:postfilter(PROP_TGT,tgt,PI)@
 @= kind_post
-        if (postfilter) {
+        if (postfilter and isnil(kind_test)) {
                var pre_kind := ws.fetch(PRE_KIND).find(contID);
                        tmp_res := 
result_part_item.leftfetchjoin(pre_kind).ord_uselect(@1).hmark([EMAIL 
PROTECTED]);
                @:mapping_code@
@@ -1861,13 +1864,13 @@
 @= no_pre
        cands := ws.fetch(PRE_SIZE).fetch(contID).mirror(); # no selection: 
cands is everything
 @= kind_pre
-      { cands := ws.fetch(PRE_KIND).fetch(contID); kind_test := kind; }
+      { cands := ws.fetch(PRE_KIND).fetch(contID); kind_test := @1; }
 @= nsloc_pre
-      { var nsloc := ns + NS_ACCEL_SEP + loc; @:prefilter(nsloc,QN_URI_LOC)@ }
+      { var nsloc := ns + NS_ACCEL_SEP + loc; 
@:prefilter(nsloc,QN_URI_LOC,ELEMENT)@ }
 @= loc_pre
-      { @:prefilter(loc,QN_LOC)@ }
+      { @:prefilter(loc,QN_LOC,ELEMENT)@ }
 @= ns_pre
-      { @:prefilter(ns,QN_URI)@ }
+      { @:prefilter(ns,QN_URI,ELEMENT)@ }
 @= prefilter
               cands := ws.fetch(PRE_SIZE).fetch(contID).mirror();
        var pre_cont := ws.fetch(PRE_CONT).fetch(contID);
@@ -1899,7 +1902,11 @@
                         }
                        postfilter := false; # we have a true candidate list
                 }
-       } # else we use postfilter (after SCJ)
+        } else {
+                # we use postfilter (after SCJ) for ns/loc/nsloc/target,
+                # but prefilter for kind
+                @:kind_pre(@3)@
+        }
 
 # expanding the scj for the different tests
 @= loop_lifted_scj_wrap1


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to