Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 29662 invoked from network); 15 Mar 2007 17:45:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2007 17:45:29 -0000 Received: (qmail 88148 invoked by uid 500); 15 Mar 2007 17:45:36 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 88111 invoked by uid 500); 15 Mar 2007 17:45:36 -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: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 88101 invoked by uid 99); 15 Mar 2007 17:45:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 10:45:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [32.97.182.144] (HELO e4.ny.us.ibm.com) (32.97.182.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 10:45:23 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2FHixZm004092 for ; Thu, 15 Mar 2007 13:44:59 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2FHhDrS225496 for ; Thu, 15 Mar 2007 13:43:13 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2FHhDYB027920 for ; Thu, 15 Mar 2007 13:43:13 -0400 Received: from [127.0.0.1] (IBM-IKEJ04B1IMA.usca.ibm.com [9.72.133.187]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2FHhCZR027877 for ; Thu, 15 Mar 2007 13:43:13 -0400 Message-ID: <45F985A2.2070505@sbcglobal.net> Date: Thu, 15 Mar 2007 10:42:58 -0700 From: Mike Matrigali Reply-To: mikem_app@sbcglobal.net User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Collation implementation WAS Re: Should COLLATION attribute related code go in BasicDatabase? References: <45F6E90F.2090706@apache.org> <45F9620E.4050105@apache.org> <45F96B54.7000502@sun.com> <45F96D80.1080102@apache.org> <45F980D9.5080706@sbcglobal.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Mamta Satoor wrote: > Excuse my ignorance, but what does it mean by "order by that spills to > the disk"? My interpretation of this is that when derby executes a statement with an order by it has to somehow sort the rows. Derby has 2 methods of doing this: 1) Carefully craft the execution plan to take advantage of an existing index that exactly matches the order by. 2) Throw all the result rows into the sorter. In case 2 there are basically 2 paths through the code: 1) if we have enough memory we sort all the rows in memory. 2) if we don't have enough memory we "spill to disk", basically we use a disk based sort algorithm. This code is different from the btree index code. > > Mamta > > > On 3/15/07, *Mike Matrigali* > wrote: > > > > Daniel John Debrunner wrote: > > Rick Hillegas wrote: > > > >> Daniel John Debrunner wrote: > >> > >>> ... > >>> > >>> - The collation type (the integer) is written into the > meta-data for > >>> an index just as ascending/descending is today (including the btree > >>> control row, thus making the information available for recovery). > >>> Collation type applies to all character columns in the index. > >>> > >> This suggests that all of the columns in the index must have the > same > >> collation? I don't think that is powerful enough to support the > >> full-blown SQL collation language, which allows you to mix > differently > >> collated columns in an ORDER BY clause. Why can't the collation > type > >> be an array of ints just as the sort direction is an array of > booleans > >> in IndexDescriptor? > > > > > > That would be more flexible, but is it required? Is an order by that > > spills to disk implemented using a BTREE? > > No, order by that spills to disk is implemented by the sorter. > > > > > Thanks, > > Dan. > > > > > > > >