[MarkLogic Dev General] Document/Root Node Indexing

Patrick Force patrickf at arc90.com
Thu Jan 18 14:03:23 PST 2007


We have a directory that includes policy data, each in a separate  
document, with the root node name InsurancePolicy.  I'm trying to  
figure out the best way to optimize querying /InsurancePolicy.  The  
documents in this directory are currently at about 20,000 and are  
quickly growing.  I'm currently trying to run queries for data  
cleaning and viewing data in general such as:

for $unattachedpolicy in /InsurancePolicy
where empty(/InsuranceProduct[@id = $unattachedpolicy/@productId and  
@version = $unattachedpolicy/@productVersion]/@id)
return <unattachedpolicy id={$unattachedpolicy/@id} productId= 
{$unattachedpolicy/@productId} productVersion={$unattachedpolicy/ 
@productVersion}/>

The time it takes this to process is very long, and I know there must  
be something we can do to improve the performance of this call and/or  
the settings for this group of documents.

I thought setting and Element Index of "InsurancePolicy" might do the  
trick, but I couldn't find a scalar type that indexes it as a node  
and setting the type as string doesn't work for most of our  
purposes.  What are some ways of improving performance of the / 
InsurancePolicy query in our scenario?  Thanks.

Patrick Force
patrickf at arc90.com



More information about the General mailing list