Indexes in xindice worked as follows (at the time I last used it, over a
year ago):
1.  The index maps from element or attribute values to documents.  It tells
you which documents in a collection contain the value in question.
2.  As such, if properly implemented, it could also be used to partially
optimize queries testing "contains", "starts_with" and "ends_with" for the
indexed elements or attributes.
3.  Once the index determines which documents to examine, each document must
be subject to extraction via the xpath of the query.  This means the entire
document must be scanned if the xpath starts with //, and large subtrees
must be scanned if the path contains // elsewhere than at the beginning.
4.  Clearly the index will work best when the documents are small and not be
useful when there is just one document.

I believe this information should help answer your questions.

Jeff
----- Original Message ----- 
From: "Eric Zhang" <[EMAIL PROTECTED]>
To: <xindice-users@xml.apache.org>
Sent: Saturday, February 21, 2004 10:01 AM
Subject: Performance with index?


> Hi all:
>   I have some question about using index on xindice. I have a fairly large
xml
> file(2.3M), with lots of nosense element, however, there are only two
element I
> interested in the file:  <div>test</div> <div name="algo"/>
>
> I want to query this xml file using xpath //div[.="test"],
//[EMAIL PROTECTED]"algo"],
> and //div to get the element I want. The processing time is pretty long.
However,
> after I add indexes
> xindice ai -c /db/test -p div
> xindice ai -c /db/test -p [EMAIL PROTECTED]
> their performance doesn't get any better.
>
> My questions are:
> - Whether the index of Xindice only helps the query on lots of files,
>   not on a sinlge file?
> - If the index can work on a single file, whether the way I am creating
>   the index is right?
> - In one word, how can I create a index on a document to help me
>   quickly find the element I want with its value or its attribute's value
>   as search keyword?
>
> Thanks a lot
>
> >
> > Yue(Eric) Zhang
> > Database Analyst/DBA, TAPoR Project
> > Arts Department, University of Alberta
> > Edmonton, AB, Canada
>
>

Reply via email to