Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 82070 invoked from network); 16 Dec 2005 00:36:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Dec 2005 00:36:45 -0000 Received: (qmail 24104 invoked by uid 500); 16 Dec 2005 00:36:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 24080 invoked by uid 500); 16 Dec 2005 00:36:43 -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 24071 invoked by uid 99); 16 Dec 2005 00:36:43 -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 16:36:43 -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.211] (HELO smtp112.sbc.mail.mud.yahoo.com) (68.142.198.211) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Dec 2005 16:36:34 -0800 Received: (qmail 49680 invoked from network); 16 Dec 2005 00:36:13 -0000 Received: from unknown (HELO ?127.0.0.1?) (ddebrunner@sbcglobal.net@71.131.200.121 with plain) by smtp112.sbc.mail.mud.yahoo.com with SMTP; 16 Dec 2005 00:36:12 -0000 Message-ID: <43A20BFB.1050905@debrunners.com> Date: Thu, 15 Dec 2005 16:36:11 -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] Updated: (DERBY-649) Useful indexes not used in UNION ALL References: <1060524664.1134627585892.JavaMail.jira@ajax.apache.org> <43A1AA79.60005@sun.com> <43A1BA2D.5050004@Sourcery.Org> <43A1D57F.6090106@debrunners.com> <43A1EFA1.1080203@Sourcery.Org> In-Reply-To: <43A1EFA1.1080203@Sourcery.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 wrote: >>And finally one real dumb question, in >>PredicateList.pushExpressionsIntoSelect I see where you ensure the >>predicate is a binary operator and has a column reference, but I can't >>see where the 'don't push expressions' logic is? >> >> >> > > By not calling pushExpressionsIntoSelect(), the code doesn't push > expressions... Where ever I find I currently can't handle the situation, > calling 'continue' in the loop skips pushing that predicate. I don't think I was clear enough. >From what I understand, your patch will push predicates like a = ? a = 3 but will not push expressions like a = (1 + b) a = cost(c) a = rate() I don't see where predicates of the first type are distinguished from those of the second type. I'm sure I'm being dumb and it's staring me in the face. In PredicateList.pushExpressionsIntoSelect I do see: line 1418 - a comment indicating (to me) that there is logic here to only push "simple" predicates. line 1421 - check to see the predicate is a binary relational node line 1425 - check to see the left is a column reference line 1431 - see if the column is referenced in where it is being pushed to but I don't see any code that says the right is "simple" so do push, or the right is "complex" so don't push. This is as much for my education on the optimizer as well as trying to understand the patch completely. Dan.