Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 31387 invoked from network); 15 May 2008 16:18:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2008 16:18:10 -0000 Received: (qmail 41986 invoked by uid 500); 15 May 2008 16:18:10 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 41966 invoked by uid 500); 15 May 2008 16:18:10 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 41955 invoked by uid 99); 15 May 2008 16:18:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 09:18:10 -0700 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: local policy) Received: from [63.246.20.101] (HELO mail.sixfriedrice.com) (63.246.20.101) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 16:17:16 +0000 Received: (qmail 32415 invoked by uid 89); 15 May 2008 16:17:37 -0000 Received: by simscan 1.4.0 ppid: 32409, pid: 32411, t: 0.2012s scanners: regex: 1.4.0 clamav: 0.91.2/m:33/d:989 Received: from unknown (HELO ?10.0.1.199?) (geoff@sixfriedrice.com@68.3.73.169) by mail.sixfriedrice.com with ESMTPA; 15 May 2008 16:17:37 -0000 Message-Id: <20695A9A-F870-4AF1-8AE0-1CBA5E1F779E@sixfriedrice.com> From: Six Fried Rice To: "Derby Discussion" In-Reply-To: <482C5E99.5010702@imageworks.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: top N reporting with derby Date: Thu, 15 May 2008 09:17:36 -0700 References: <482A3C51.7080202@imageworks.com> <200805151309.19607.daniel@nuix.com> <482C5E99.5010702@imageworks.com> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org On May 15, 2008, at 9:02 AM, Matt Chambers wrote: > Just googling around I would say that the LIMIT/OFFSET feature has > to be the #1 requested Derby feature of all time. Paging is such a necessary part of web development, and MySQL, despite its warts, really gets it right. It is a hassle to have to jump through hoops (subselects, temp tables, inverted sort orders, ...) to do it. It is a shame because apparently the "standard" has no provision for this. But when you're putting data on the web, you simply must page records. And with MySQL it is a snap to augment any query to add paging, and it is fast. So I am not surprised this is a major FAQ. I have the same problem with MSSQL as well. But my vague memory is that I can put ROW_NUMBER in a FROM clause in Sybase, and then use it in my WHERE, making it easy there as well. We're pretty much back to square 1 on paging in Derby because we need to sort *before* we page (obviously). So now we're trying temporary tables (nuisance because our system uses configurable queries) and just spinning through the result set in Java. Geoff