[MarkLogic Dev General] my link resolver is slow

Michael Sokolov sokolov at ifactory.com
Thu Aug 9 04:41:29 PDT 2012


On 8/8/2012 5:02 PM, Ron Hitchens wrote:
>     If you're looking at lots of documents, but only making
> updates to one or a few, you may be incurring a lot of unnecessary
> locking.  Even if there is no contention for the locked documents,
> it takes resources to acquire, track and release them, especially
> in a cluster.
>
>     If you can structure your code so that it runs mostly as a
> read-only query (if xdmp:timestamp returns an empty sequence,
> you're an update even if you never make any actual changes) it
> will run lock-free.  You can use xdmp:eval or xdmp:invoke to do
> the actual updates in a separate transaction, which will only
> need to lock the document(s) that it's updating.
Ah- thank you I will try that.  Right now all the read queries (100's 
per document updated) are in the same transaction as the writes, 
although I am *trying* only to retrieve the uris of these documents, but 
I suspect that

cts:search (...)/base-uri() might have to read the docs?

  Perhaps Danny's suggestion of cts:uris () with a query will help there.

-Mike


More information about the General mailing list