As David said, you probably won't need to make any changes to the index config 
for some time. Mostly folks make changes to tweak full-text search capabilities.

But I thought I'd point out that you can check the evaluation of an XPath. Note 
that I added a missing '@' to your original expression.

  xdmp:plan(//usr[@id='123'])

If you see a term appear as a "constraint" in the output, then there is an 
index lookup for that term. I see: Step 2 predicate 1 contributed 2 
constraints: @id = "123". Actually that's a little misleading, because the 
constraint is really usr[@id]. Naked attributes are not indexed: 
element-attribute pairs are indexed. But this XPath evaluation does use indexes.

You will probably want to move those blobs into their own documents, so that 
you can store and retrieve them more efficiently. MarkLogic extends the XQuery 
data model with the notion of blob documents: documents that have a root node 
of type binary() - another extension to XQuery 1.0. Binary documents cannot 
contain any other node types.

http://docs.marklogic.com/5.0doc/docapp.xqy#display.xqy?fname=http://pubs/5.0doc/xml/dev_guide/binaries.xml

You can construct a true binary node from a hexBinary or base64Binary item, 
using the computed binary constructor. That is another extension feature:

  binary { $hexBinary }

You can xdmp:document-insert() the resulting binary() node into its own binary 
document. This provides more efficient storage and retrieval than keeping 
hexBinary or base64Binary items in your XML documents.

-- Mike

On 21 Feb 2012, at 07:00 , Todd Gochenour wrote:

> Here's an update.  Turns out there's another database I need to port to 
> XQuery.  The first one was admin.  The second one has attachments stored as 
> blobs in the database, so I turned on the hex-blob option in mysqldump to get 
> a 537MB database extract.  The blobs were marked up with the attribute 
> xsi:type="xs:hexBinary" but the xs names was not defined and MarkLogic didn't 
> like that much.   I downloaded gVIM (google said it was the best at editing 
> large files) and appended xmlns:xs="http://www.w3.org/2001/XMLSchema"; to the 
> root element.  Now it's in the database.
>  
> So here's a question.  I guess there is no index on the id attributes of this 
> database by default,  is that correct?  In performing the denormalization, 
> I'll need to be find all documents that possess an element with an id child 
> equal to a value, say by using the xpath "//usr[id='123']".   I'll need to 
> tune the database to optimize this, yes?   I'm currently reading up on 
> MarkLogic application services database settings to see if what I need to 
> define is a field.
>  
>     
>  
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to