Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 58199 invoked from network); 28 Nov 2004 16:03:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Nov 2004 16:03:06 -0000 Received: (qmail 60526 invoked by uid 500); 28 Nov 2004 16:03:00 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 60475 invoked by uid 500); 28 Nov 2004 16:03:00 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 60427 invoked by uid 99); 28 Nov 2004 16:02:59 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from smtp.dkm.cz (HELO smtp.dkm.cz) (62.24.64.34) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 28 Nov 2004 08:02:58 -0800 Received: (qmail 61190 invoked by uid 0); 28 Nov 2004 16:02:53 -0000 Received: from lin.code.cz (HELO ?62.245.69.249?) (62.245.69.249) by smtp.dkm.cz with SMTP; 28 Nov 2004 16:02:52 -0000 Message-ID: <41A9F6BC.7010303@code.cz> Date: Sun, 28 Nov 2004 17:03:08 +0100 From: =?ISO-8859-1?Q?Jan_Hlavat=FD?= User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: Support for SQL Limit? References: <005801c4d4b6$f83166a0$6401a8c0@brianxp> <41A95632.3010301@debrunners.com> In-Reply-To: <41A95632.3010301@debrunners.com> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE4CC3BAB91F186D9223135C3" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE4CC3BAB91F186D9223135C3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Daniel John Debrunner wrote: > Derby supports limiting the number of rows returned by a query through > the standard JDBC java.sql.Statement.setMaxRows() method. And does it affect the execution plan? Knowing the maximum number of records would be extremely useful for query optimizer, which could select a much faster plan using indexes which otherwise has higher "per record" cost over mass methods like full table scan... This was (is?) one of the major shortcomings in SapDB - it always realized query for first few records starting with specific value in an (existing) index order by full table scan and sort, thinking the index scan would cost much more. Jan --------------enigE4CC3BAB91F186D9223135C3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iQEVAwUBQan2wHFDePgyse5HAQI/yAf9F+z7goZiFjCaqJckl9Qg3bcW6l666ixV OKQCKa0NdhYbpTOqk3yO7soXqKygLOHJncYJJonbYzutPWzu9288X6snVUM23VkM IVuC2kMsGCDxFYflP3L0LzT+F7aEbOGkjTZ7nmgJsPng8qS0u2G0Ip0o518VyI6w KlgFfJxYoDHIRQ0Fba0lX0CtAKmFw/G/3q9butAKSXeveYtx3rrqy2qUV7cuACCb jU3gfWz0mcQYcr5+twbstDN1EXc9jD6ApMR0whvFGoVo7Fy+Lnb6sQyotbtRZjr7 xTYSxISg0iHaTX0dYrtDWLg9GR7XV38GXLNNxeijGA35pUlm+taWaQ== =QjAe -----END PGP SIGNATURE----- --------------enigE4CC3BAB91F186D9223135C3--