Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 16563 invoked from network); 15 May 2009 14:35:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 May 2009 14:35:16 -0000 Received: (qmail 22738 invoked by uid 500); 15 May 2009 14:35:16 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 22720 invoked by uid 500); 15 May 2009 14:35:16 -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 22706 invoked by uid 99); 15 May 2009 14:35:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2009 14:35:16 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.221.174] (HELO mail-qy0-f174.google.com) (209.85.221.174) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2009 14:35:04 +0000 Received: by qyk4 with SMTP id 4so3620733qyk.26 for ; Fri, 15 May 2009 07:34:43 -0700 (PDT) Received: by 10.224.73.139 with SMTP id q11mr3929444qaj.120.1242398082967; Fri, 15 May 2009 07:34:42 -0700 (PDT) Received: from ?192.168.0.5? (ppp-70-245-238-35.dsl.stlsmo.swbell.net [70.245.238.35]) by mx.google.com with ESMTPS id 9sm3546068ywf.42.2009.05.15.07.34.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 15 May 2009 07:34:42 -0700 (PDT) Message-Id: From: Robert Zeigler To: user@cayenne.apache.org In-Reply-To: <23560831.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 09:34:40 -0500 References: <23555842.post@talk.nabble.com> <3219fff70905150203m5b64fa23o1000be94502fc881@mail.gmail.com> <23560831.post@talk.nabble.com> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org 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. >