Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 27107 invoked from network); 15 Dec 2005 08:20:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Dec 2005 08:20:54 -0000 Received: (qmail 97715 invoked by uid 500); 15 Dec 2005 08:20:53 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 97676 invoked by uid 500); 15 Dec 2005 08:20:52 -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 97667 invoked by uid 99); 15 Dec 2005 08:20:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2005 00:20:52 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [68.142.198.201] (HELO smtp102.sbc.mail.mud.yahoo.com) (68.142.198.201) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Dec 2005 00:20:51 -0800 Received: (qmail 46071 invoked from network); 15 Dec 2005 08:20:30 -0000 Received: from unknown (HELO ?127.0.0.1?) (ddebrunner@sbcglobal.net@71.131.200.190 with plain) by smtp102.sbc.mail.mud.yahoo.com with SMTP; 15 Dec 2005 08:20:29 -0000 Message-ID: <43A12705.1080407@debrunners.com> Date: Thu, 15 Dec 2005 00:19:17 -0800 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, de MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: [jira] Commented: (DERBY-649) Useful indexes not used in UNION ALL References: <1223571006.1134627466692.JavaMail.jira@ajax.apache.org> In-Reply-To: <1223571006.1134627466692.JavaMail.jira@ajax.apache.org> 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 Satheesh Bandaram (JIRA) wrote: > [ http://issues.apache.org/jira/browse/DERBY-649?page=comments#action_12360485 ] > > Satheesh Bandaram commented on DERBY-649: > ----------------------------------------- > > I have a patch for this bug. While I am still testing it, I would appreciate any comments about my approach. I have a customer who is hurting a lot because of this bug. Once complete, I would like to put this fix into both 10.1.x and trunk versions. > > I have implemented a simpler solution to address this optimization for some cases where predicates are of the form . These causes really benifit the most by pushing predicates down these into inner selects of union, since that would enable optimizer to use applicable indexes on them. > > I will also enhance this patch to make it more generic for trunk later. When you say , can the constant be a parameter? And closely related, in the code (UnionNode.java) you say 'For now, we only push simple + * single column predicates that are binaryOperations.' Does this need to be clarified? Maybe state explictly what can be pushed down, maybe 'simple' to you, would be 'complex' to me? Could you explain new the code in pushExpressionsIntoSelect? Since you have spent time on this, it would be great to capture your thoughts in the code comments. For example, why do we need a new nodes that represent '= TRUE', I'm sure it's required but to a reader of the code it's not obvious why. Great patch to improve performance! Dan.