Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 57451 invoked from network); 18 Aug 2007 08:03:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Aug 2007 08:03:01 -0000 Received: (qmail 63814 invoked by uid 500); 18 Aug 2007 08:02:58 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 63783 invoked by uid 500); 18 Aug 2007 08:02:58 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 63773 invoked by uid 99); 18 Aug 2007 08:02:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Aug 2007 01:02:58 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=DNS_FROM_DOB,RCVD_IN_DOB,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcaj-jackrabbit-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Aug 2007 08:02:56 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IMJGN-0005Ii-5e for dev@jackrabbit.apache.org; Sat, 18 Aug 2007 10:02:27 +0200 Received: from gateway.subshell.com ([212.79.22.193]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Aug 2007 10:02:27 +0200 Received: from christoph by gateway.subshell.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Aug 2007 10:02:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: dev@jackrabbit.apache.org From: Christoph Kiehl Subject: Re: Total size of a query result and setLimit() Date: Sat, 18 Aug 2007 10:01:33 +0200 Lines: 32 Message-ID: References: <46C59EE7.3090605@gmx.net> <5f211bd50708170654k49db8856x65d5d6053d3582b3@mail.gmail.com> <46C5C270.7030409@gmx.net> <5f211bd50708170903i3b45872ah86345e5508c87ef5@mail.gmail.com> <510143ac0708171616vee8f09fr14b744d91ca25e80@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: gateway.subshell.com User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <510143ac0708171616vee8f09fr14b744d91ca25e80@mail.gmail.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Jukka Zitting wrote: > Hi, > > On 8/17/07, Christoph Kiehl wrote: >> Thomas Mueller wrote: >>> That's a good idea! Implementations that can't support it efficiently >>> could then calculate the size only when required. What about >>> getTotalSize()? >> Implementations should maybe even allowed to return -1 (as on >> RangeIterator.getSize()) if they do not support this method ... > > I don't like the -1 result. As long as it's allowed, an interoperable > client must always assume that an implementation may return -1 and > provide a workaround for such cases. I don't like it either, but I have absolutely no idea what kind of systems there are trying to implement the JCR API and if they are capable of providing a total result size. Until now, without setLimit(), they weren't forced to return the total size in RangeIterator.getSize() so I thought it might be necessary to provide that option for other implementors because at least one off them seems to need that -1 return value. But if it isn't necessary I would definitely like to skip that option. > How is the total size question typically solved in cases where an > application pages through a large database result set? I recall > sometimes using a separate COUNT(*) query for that, but there may be > more efficient alternatives. That's what Thomas suggested as well and I know of no other option. Cheers, Christoph