Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 67770 invoked from network); 3 Aug 2005 04:43:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Aug 2005 04:43:14 -0000 Received: (qmail 3276 invoked by uid 500); 3 Aug 2005 04:43:13 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 3255 invoked by uid 500); 3 Aug 2005 04:43:12 -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 3242 invoked by uid 99); 3 Aug 2005 04:43:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 21:43:12 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=SPF_HELO_FAIL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.110.132] (HELO e34.co.us.ibm.com) (32.97.110.132) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 21:43:03 -0700 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e34.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j734h9RX211768 for ; Wed, 3 Aug 2005 00:43:09 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j734hH4l185330 for ; Tue, 2 Aug 2005 22:43:17 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j734h9me028995 for ; Tue, 2 Aug 2005 22:43:09 -0600 Received: from [127.0.0.1] (sig-9-48-111-6.mts.ibm.com [9.48.111.6]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j734h86t028980 for ; Tue, 2 Aug 2005 22:43:08 -0600 Message-ID: <42F04B5B.4090104@debrunners.com> Date: Tue, 02 Aug 2005 21:43:07 -0700 From: Daniel John Debrunner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Functional indexes WAS Re: jira question References: <42E97A33.2020204@sun.com> <42EA73C5.7040101@sbcglobal.net> <42EA7D8E.3020605@Sourcery.Org> <42EAC8CC.3060104@Sourcery.Org> <42EAD360.3020108@sun.com> <42EE5278.506@sbcglobal.net> In-Reply-To: X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Manish Khettry wrote: > On 8/1/05, Mike Matrigali wrote: > >>I still think >>it would be nice if the optimizer could tell that an expression in >>a where clause matched the result of the expression which generated >>the column, otherwise indexes on the generated column aren't as interesting. >> > > > The expression used for the generated column must be stored in the > data dictionary. Does derby serialize expressions? I was looking > around in the classes in impl/sq/compile (ValueNode and such) and > these classes don't seem to implement Formatable. Compile nodes (and classes) are runtime only. They are never serialized to disk and are not designed for that. Any runtime representation of a compiled entity uses a specific class, such as RoutineAliasInfo. An initial approach to this functional indexing may to to make the scheme work for simple expressions, function calls on single columns, eg. UPPER(lastname). Just getting that to work would solve most of the typical uses and would be a good step towards a complete solution. Handling arbitary expressions up front may be too much to bite off. Dan.