Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30775/modules/pftijah
Modified Files:
Tag: M5XQ
serialize_pftijah.mx
Log Message:
propagated changes of Thursday Sep 24 2009 - Monday Sep 28 2009
from the development trunk to the M5XQ branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/24 - jflokstra: modules/pftijah/serialize_pftijah.mx,1.78
* fix INEX graph bug on <TAG/> nodes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/25 - hrode: modules/pftijah/serialize_pftijah.mx,1.79
- several fixes for the fragmented indexing
- tijah now automatically queries all fragments of the index
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/09/25 - jflokstra: modules/pftijah/serialize_pftijah.mx,1.80
- Remove excessive GDKalloc()/GDKfree() for INEX stack. Suppose
#define XML_MAX_NAMELEN 100 in libxml2/parserInternals.h also
limits tagnames to 100.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: serialize_pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/serialize_pftijah.mx,v
retrieving revision 1.72.2.4
retrieving revision 1.72.2.5
diff -u -d -r1.72.2.4 -r1.72.2.5
--- serialize_pftijah.mx 23 Sep 2009 07:27:04 -0000 1.72.2.4
+++ serialize_pftijah.mx 28 Sep 2009 07:56:16 -0000 1.72.2.5
@@ -42,7 +42,7 @@
/* #define TJ_TRACE 1 */
-/* #define USE_INEX_PATH 1 */
+/* #define USE_INEX_PATH 1 */
/*******************************************
* serialize_pftijah.c : XML serialization
@@ -206,6 +206,9 @@
#ifdef USE_INEX_PATH
+/* this def is copied from libxml2/parserInternals.h */
+#define XML_MAX_NAMELEN 100
+
/*
* Start of the implementation of the INEX path generator. During indexing
* this structure will keep track of the used tags in the current path. The
@@ -238,7 +241,7 @@
int prev_frame; /* previous level frame, -1 for bottom */
} level;
struct {
- str strVal; /* string value of the tagname */
+ char strVal[XML_MAX_NAMELEN];/* string value of tagname */
int cnt; /* number of times used at this level */
} tag;
} IpgFrame;
@@ -252,7 +255,7 @@
char* pathbuff; /* the path printing buffer */
} IpgBase;
-#define IPG_INIT_STACKSZ 512
+#define IPG_INIT_STACKSZ 256
#define IPG_INIT_PATHSZ 8192
@@ -279,7 +282,10 @@
base->top = 0;
base->stack[base->top].level.ntags = 0;
base->stack[base->top].level.prev_frame = -1;
- sprintf(base->pathbuff,"fn:doc(\"%s\")",doc);
+ if ( 1 /* Henning: use docnames in path */ )
+ sprintf(base->pathbuff,"fn:doc(\"%s\")",doc);
+ else
+ sprintf(base->pathbuff,"%s","");
base->stack[base->top].level.subpath = strlen(base->pathbuff);
return 1;
}
@@ -313,7 +319,7 @@
ipg_frame_alloc(base);
base->stack[base->top].level.ntags++;
found = &
base->stack[base->top+base->stack[base->top].level.ntags];
- found->tag.strVal = (str)GDKstrdup(tag);
+ strcpy(found->tag.strVal,tag);
found->tag.cnt = 0;
}
found->tag.cnt++;
@@ -338,15 +344,10 @@
return 1;
}
-static int ipg_poptag(IpgBase* base) {
- /* free tag strings used at the top level */
- for(int i=0; i< base->stack[base->top].level.ntags; i++) {
- GDKfree(base->stack[base->top+i+1].tag.strVal);
- }
-
+static INLINE int ipg_poptag(IpgBase* base) {
base->top = base->stack[base->top].level.prev_frame;
- if (0) stream_printf(GDKout,"-IPG[pop: path=%s]\n",base->pathbuff);
+ /* stream_printf(GDKout,"-IPG[pop: path=%s]\n",base->pathbuff); */
return 1;
}
@@ -852,7 +853,9 @@
if ( !(res->b_docFirstPre = getBAT(tjCtx_BAT,"doc_firstpre")) ) return
NULL;
if ( !(res->b_collPre = getBAT(tjCtx_BAT,"tid")) ) return NULL;
if ( !(res->b_collSize = getBAT(tjCtx_BAT,"size")) ) return NULL;
+#ifdef USE_INEX_PATH
if ( !(res->b_collPath = getBAT(tjCtx_BAT,"path")) ) return NULL;
+#endif
if ( (res->tijahPre = getPreSize(res)) == oid_nil )
return NULL;;
/* check here for new fragmentation */
@@ -1315,6 +1318,10 @@
}
if (tjctx->dict_handler &&
!handle_dictionary(tjctx,tjctx->level_pre[tjctx->doc_height]))
return 0;
+#ifdef USE_INEX_PATH
+ if ( !ipg_poptag(tjctx->ipg) )
+ return 0;
+#endif
return 1;
}
------------------------------------------------------------------------------
Come build with us! The BlackBerry® 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/devconf
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins