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. -- Mike On 21 Feb 2012, at 02:57 , Jonathan Cook - FM&T wrote: > Hi, > > 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: > <qm:elapsed-time>PT0.000773S</qm:elapsed-time> > > When adding in the xinc:node-expand it then takes: > <qm:elapsed-time>PT0.351562S</qm:elapsed-time> > > Which is a huge difference and I have also seen much bigger variations than > this? > > Thanks > Jon > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
