Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 17889 invoked from network); 2 Oct 2009 18:27:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Oct 2009 18:27:22 -0000 Received: (qmail 1345 invoked by uid 500); 2 Oct 2009 18:27:21 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 1271 invoked by uid 500); 2 Oct 2009 18:27:21 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 1261 invoked by uid 99); 2 Oct 2009 18:27:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 18:27: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 (nike.apache.org: domain of mtylenda@o2.pl designates 193.17.41.16 as permitted sender) Received: from [193.17.41.16] (HELO rekin23.go2.pl) (193.17.41.16) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 18:27:12 +0000 Received: from rekin23.go2.pl (rekin23 [127.0.0.1]) by rekin23.go2.pl (Postfix) with ESMTP id 9DFC41288D0 for ; Fri, 2 Oct 2009 20:26:51 +0200 (CEST) Received: from o2.pl (unknown [10.0.0.37]) by rekin23.go2.pl (Postfix) with SMTP for ; Fri, 2 Oct 2009 20:26:51 +0200 (CEST) Subject: =?UTF-8?Q?Re:_Result_limit?= From: =?UTF-8?Q?Mi=C5=82osz_Tylenda?= To: users@openjpa.apache.org In-Reply-To: <010b01ca437f$f4430160$dcc90420$@com> References: <010b01ca437f$f4430160$dcc90420$@com> Mime-Version: 1.0 Message-ID: <35e7b753.341075e6.4ac645ea.43837@o2.pl> Date: Fri, 02 Oct 2009 20:26:50 +0200 X-Originator: 89.74.167.102 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Chris, Have=20you=20tried=20Query.setMaxResults(int)?=20This=20should=20be=20wha= t=20you=20are=20looking for. The=20mentioned=20hint=20has=20currently=20effect=20only=20with=20DB2.=20= It=20appends=20to=20the generated=20SQL=20some=20DB2-specific=20syntax=20so=20that=20the=20databa= se=20knows=20we=20are expecting=20from=20the=20query=20N=20rows.=20The=20database=20then=20can=20= optimize=20its=20query=20plan.=20The hint=20does=20not=20however=20change=20the=20number=20of=20rows=20returne= d. BTW,=20your=20mail=20has=20Reply-To=20set=20to=20your=20address,=20not=20= the=20list. Cheers, Milosz >=20Is=20there=20any=20way=20to=20limit=20the=20size=20of=20a=20result=20= set=20so=20that=20you=20an=20specify >=20the=20maximum=20number=20of=20records=20returned? >=20 >=20=20 >=20 >=20I=20tried: >=20 >=20=20 >=20 >=20Query.setHint("openjpa.hint.OptimizeResultCount",new=20Integer(100)) >=20 >=20=20 >=20 >=20But=20the=20generated=20SQL=20has=20no=20sign=20of=20it.=20I=20was=20= expecting=20the=20generated=20SQL >=20to=20include=20the=20LIMIT=20keyword=20however=20it=20doesn't. >=20 >=20=20 >=20 >=20Using=20OpenJPA=201.2.1=20and=20MySQL=205. >=20 >=20=20 >=20 >=20Chris >=20 >=20