Re: [bdbxml] query many number of document

George Feinberg <[email protected]> Tue, 18 Apr 2006 17:20:35 -0400
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
Hello,

First, your indexes on "file" and "dir" are not going to
be useful, as they have no obvious text values.
Your index on @path should be used by the queries you
mention.

What is the query plan output?  e.g. using dbxml shell:
dbxml> openContainer "your_container_name"
dbxml> queryPlan "your_query_here"

If you are querying for path, and all 100,000 of your
documents are in the same directory (i.e. have the same
path value), you will have a lot of results, and that will take
some time.

How many results are you getting from your queries?

Regards,

George

>
> This is my document (Roughly)
> May contain maximum of 5 vers if have.
> Like this I have 100,000 documents...
>
> <drive name="c:">
>  <dir name="test" path="c:\test">
>   <file name="file.txt" path="c:\test\file.txt">
>     <ver>
>        <number>2</number>
>        <size>100</size>
>        <date>100</size>
>        <fileid>100</size>
>        <blk>
>           <num>1</num>
>           <length>200</length>
>         </blk>
>       </ver>
>     <ver>
>        <number>1</number>
>        <size>100</size>
>        <date>100</size>
>        <fileid>100</size>
>        <blk>
>           <num>1</num>
>           <length>200</length>
>         </blk>
>       </ver>
>   </file>
>   </dir>
> </drive>
>
>
> I have added the following indexes..
>
> ad.addIndex( openedCont, "", "path","node-attribute-equality- 
> string", txn,
> updateContext );
>             ad.addIndex( openedCont, "",
> "file","node-element-equality-string", txn, updateContext );
>             ad.addIndex( openedCont, "",
> "dir","node-element-equality-string", txn, updateContext );
>
>
> Its taking lot of time to get the results set  for the queries  
> below...
>
> 1.  query =
> "distinct-values("+collection+"//dir[@path=\""+path+"\"]/dir[1]/ 
> @path/string())";
>
> 2.  query  = collection+"//dir[@path=\""+path+"\"]/file[1]";
>
>
>            XmlQueryExpression nameExpr = theMgr.prepare(query, qc);
>             XmlResults nameResults = nameExpr.execute(qc);
>             System.out.println("xml result size "+nameResults.size());
>             XmlValue value = null; //results.next();
>             String name = "";
>             while(nameResults.hasNext()){
>                 value = nameResults.next();
>                 System.out.println(value.asString());
>             }
>
>


------------------------------------------
To remove yourself from this list, send an
email to [email protected]