Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 89671 invoked from network); 16 Jun 2009 17:58:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Jun 2009 17:58:50 -0000 Received: (qmail 20547 invoked by uid 500); 16 Jun 2009 17:59:02 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 20534 invoked by uid 500); 16 Jun 2009 17:59:02 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 20524 invoked by uid 99); 16 Jun 2009 17:59:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2009 17:59:02 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.86.89.64] (HELO elasmtp-curtail.atl.sa.earthlink.net) (209.86.89.64) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2009 17:58:52 +0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=CP5a65Ndc+S8JJoC4IGL8e+cr2Rlpad0i1vcGrs21zqDmXUclNq30elWw5I+1m3q; h=Received:Message-Id:From:To:In-Reply-To:Content-Type:Content-Transfer-Encoding:Mime-Version:Subject:Date:References:X-Mailer:X-ELNK-Trace:X-Originating-IP; Received: from [24.253.146.147] (helo=[10.0.1.2]) by elasmtp-curtail.atl.sa.earthlink.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.67) (envelope-from ) id 1MGcvX-0002rv-P1 for user@cayenne.apache.org; Tue, 16 Jun 2009 13:58:31 -0400 Message-Id: From: Joe Baldwin To: user@cayenne.apache.org In-Reply-To: <3219fff70906161045i35d27b79x5ccfd206aff8c658@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: Faulting Behavior with setPageSize() and Sort Ordering Date: Tue, 16 Jun 2009 13:58:31 -0400 References: <52DE51F7-65CE-4D06-9F55-38F43D976C3F@earthlink.net> <3219fff70906161045i35d27b79x5ccfd206aff8c658@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-ELNK-Trace: 74aacf41df18ac9f85338a7d01cb3b6a7e972de0d01da940cdfe520961546acef97e608d744c256a350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 24.253.146.147 X-Virus-Checked: Checked by ClamAV on apache.org That sounds logical. So if I limit my sort ordering to the initial query then the objects in pages 2-n will remain hollow? (I have a few instances in which there is sort ordering by the client (which is post query - resultset ordering). I will have to take a look at this design to implement this rule better.) Thanks, Joe On Jun 16, 2009, at 1:45 PM, Andrey Razumovsky wrote: > The trick of paginated query is that all objects returned are > HOLLOW, thus > having only identifier. Ordering.orderList will surely resolve *all* > records, how else would it know parameters of each object. To order > a long > list properly you need to set ordering to a query: > > query.setPageSize(RowsPerPage); > query.addOrdering(order); > List orderedResults = context.performQuery(query); > > 2009/6/16 Joe Baldwin > >> This is a question concerning making performance enhancements with >> Cayenne >> directives. >> >> Lets say you use the following SelectQuery method >> >> query.setPageSize(RowsPerPage); >> >> But then you decide to sort order the result list using >> >> Ordering order = new Ordering(._PROPERTY, >> true); >> order.orderList(resultList); >> >> If I understand the docs, then the purpose of setting the PageSize >> parameter is to reduce the work load (and increase performance) by >> limiting >> fetching to the first "RowsPerPage" amount of data-objects. >> >> I am wondering whether performing a sort ordering on the resultList >> triggers *all* the page and object faults. If I am correct then sort >> ordering would render setPageSize moot in this scenario. >> >> Is my analysis correct or has Cayenne somehow avoided this? (Or is >> there >> another way to do sort ordering?) >> >> Joe >> >> >>