jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: JCR-SQL2 : no count when WHERE clause is provided
Date Thu, 30 Sep 2010 15:09:39 GMT
On Thu, Sep 30, 2010 at 11:55, Clemens Wyss <clemensdev@mysign.ch> wrote:
> Hi all,
> on the sling mailinglist (http://mail-archives.apache.org/mod_mbox/sling-users/201009.mbox/%3C4CA4457A.9010006@gmail.com%3E)
we have been discussing the follwoing issue:
> whenever you provide a where-clause to a sql2 select, jcr/jackrabbit does not provide
the hit count.
> E.g.:
>   select * from [nt:unstructured]
>   order by [jcr:score]
> returns the hit count (query.execute().getRows().getSize()), whereas
>  select * from [nt:unstructured]
>  where entity = "customer"
>  order by [jcr:score]
> doesn't.
> Is this a bug or a feature?

I am not too familiar with the specific sql2 query implementation, but
Nodes/RowIterator.getSize() can return -1 as an optimization (if
counting would make the implementation slower). For the classic
Xpath/SQL search implementation getSize() returns -1 normally, only an
order by triggers it (because it has to load and sort the whole result
set anyway). It will be something similar in the sql2 implementation.


Alexander Klimetschek

View raw message