Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 35773 invoked from network); 15 May 2009 19:09:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 May 2009 19:09:22 -0000 Received: (qmail 28282 invoked by uid 500); 15 May 2009 19:09:21 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 28232 invoked by uid 500); 15 May 2009 19:09:21 -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 28206 invoked by uid 99); 15 May 2009 19:09:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2009 19:09:21 +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 [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 15 May 2009 19:09:11 +0000 Received: (qmail 2651 invoked from network); 15 May 2009 19:08:50 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 15 May 2009 19:08:50 -0000 Message-Id: <3A0C74ED-602F-4409-9F1A-E298C4C0B18C@objectstyle.org> From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: <23561312.post@talk.nabble.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: Big selects on PostGres : Configuring Statement.setFetchSize() of a selectquery Date: Fri, 15 May 2009 22:08:49 +0300 References: <23555842.post@talk.nabble.com> <3219fff70905150203m5b64fa23o1000be94502fc881@mail.gmail.com> <23560831.post@talk.nabble.com> <23561312.post@talk.nabble.com> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org I haven't experimented with that much (so no idea which drivers take advantage of that and which would simply ignore it), but that would indeed be a useful parameter for ResultIterator scenario. So maybe open a feature request in Jira? Andrus On May 15, 2009, at 5:45 PM, stefcl wrote: > > Thanks, > > Since the beginning I am convinced that resultiterators are the > right way, > unfortunately they are useless if the jdbc driver loads everything > in memory > before giving access to the resultset. > > I hope there's something to do about it because it's a showstopper > for me. > > > Robert Zeigler-6 wrote: >> >> Take a look at paginated queries (which isn't /quite/ what you want, >> but may help you): >> >> http://cayenne.apache.org/doc/paginated-queries.html >> >> As well as ResultIterator: >> http://cayenne.apache.org/doc/iterating-through-data-rows.html >> >> Robert >> >> On May 15, 2009, at 5/159:21 AM , stefcl wrote: >> >>> >>> >>> Thanks but my problem is not related to paging. >>> >>> I would like to be able to execute a select query which returns >>> approx >>> 100000 rows with a single selectQuery and process them one by one, >>> while >>> keeping only a few of them in memory (using the resultiterator). >>> >>> In jdbc, Statement.setFetchSize(1000) tells the jdbc driver to >>> retrieve >>> results from the database 1000 at a time and ask for the next 1000 >>> as you're >>> iterating the resultset. Otherwise its default behavior is to >>> retrieve the >>> 100'000 rows in memory before you can start iterating the resultset. >>> >>> It's not the same thing as inserting a TOP or a LIMIT clause in the >>> query. >>> >>> Any help appreciated >>> >>> >>> Andrey Razumovsky wrote: >>>> >>>> Hi, >>>> >>>> Yes of course. You can use SelectQuery.setFetchLimit(int) and >>>> setFetchStart(int) methods. They do just that. >>>> >>>> Andrey >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Big-selects-on-PostGres-%3A-Configuring-Statement.setFetchSize%28%29-of-a-selectquery-tp23555842p23560831.html >>> Sent from the Cayenne - User mailing list archive at Nabble.com. >>> >> >> >> > > -- > View this message in context: http://www.nabble.com/Big-selects-on-PostGres-%3A-Configuring-Statement.setFetchSize%28%29-of-a-selectquery-tp23555842p23561312.html > Sent from the Cayenne - User mailing list archive at Nabble.com. > >