Bloomin' brackets again!  Gets me every time :)

Thanks for your lightning fast help, as ever.

-----Original Message-----
From: Christopher Hamlin <[email protected]>
Reply-To: MarkLogic Developer Discussion <[email protected]>
Date: Wednesday, 10 September 2014 16:39
To: MarkLogic Developer Discussion <[email protected]>
Subject: Re: [MarkLogic Dev General] Why does adding a range to a path
query make it it significantly slower?

/publication looks like an xpath.  You're looking for root elements of
'publication'?

If you are doing /publication[1 to 3] you are applying a position
predicate (first or second or third) to all the publication nodes.

Try (/publication)[1 to 3] and you'll be just selecting the first 3
from the sequence.  It'll be fast, like doing
fn:subsequence(/publication, 1, 3).

On Wed, Sep 10, 2014 at 11:29 AM, Rachel Wilson <[email protected]>
wrote:
> We have noticed something that is unintuitive to us and we were
>wondering if
> someone could give us an explanation.
>
> We have 43,472 records and if we issue the following, simple, xquery it
> returns almost immediately:
>
> /publication
>
> But if we issue the following, well the query doesn't return anything
>before
> we get a query timeout so I don't know how long it takes to come back:
>
> /publication[1 to 3]
>
> We thought URIs were indexed and so even a putting a range on them should
> still be super quick. Erm, what's going on here?
>
> Many thanks,
> Rachel
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
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