[MarkLogic Dev General] Alternative to using xincludes
mike at blakeley.com
Tue Feb 21 10:19:45 PST 2012
I haven't profiled that code, but I could see XInclude expansion doing a lot of work. On the other hand an element-attribute lookup uses indexes and requires very little work.
Indexing element-attribute values is a way of moving work from retrieval time to update time, and happens automatically. The equivalent with XInclude would be to use the CPF pipeline, which creates a fully-expanded form of the affected document(s). That way read-only queries can simply retrieve the document, without needed any expansion work.
http://docs.marklogic.com/5.0doc/docapp.xqy#display.xqy?fname=http://pubs/5.0doc/xml/dev_guide/mod-docs.xml%2382876 describes the CPF pipeline and how to set it up.
On 21 Feb 2012, at 02:57 , Jonathan Cook - FM&T wrote:
> Using the xinc:node-expand seems to be a very expensive operation so I wondered if there were any alternatives. For example a query to retrive a document based on a given attribute responds very quickly:
> When adding in the xinc:node-expand it then takes:
> Which is a huge difference and I have also seen much bigger variations than this?
> General mailing list
> General at developer.marklogic.com
More information about the General