You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Thomas Mueller <mu...@adobe.com> on 2014/08/01 12:29:47 UTC

Re: Order of property restrictions in Query Filter

Hi,

Sorry, I don't understand. In my view, the queries

    select [jcr:path] from [nt:base] where id = '1' and x = '2'

and

    select [jcr:path] from [nt:base] where x = '2' and id = '1'

are equivalent (it doesn't matter in which order the conditions were
written). It a certain *index* is faster if it uses id or x first, then
that's up to the index to decide. But the application developer (who wrote
the query) wouldn't know that. It would depend on the data, and the data
might change.


Regards,
Thomas






On 31/07/14 17:15, "Chetan Mehrotra" <ch...@gmail.com> wrote:

>Suppose we have a query like
>
>select [jcr:path]
>  from [nt:base]
>  where id = '1' and x = '2'
>
>Currently the property restrictions are maintained as a HashMap in
>FilterImpl so above ordering information would be lost.
>
>Such ordering information might be useful when querying against Lucene
>index. The Boolean query created would maintain the order and might be
>faster if the result from first clause is small.
>
>Would it make sense to retain the order of property restrictions?
>
>Chetan Mehrotra