db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: [jira] Updated: (DERBY-649) Useful indexes not used in UNION ALL
Date Fri, 16 Dec 2005 02:32:19 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
I think I have addressed this... I would like to do these next:<br>
  <li>Incorporate your suggestions about comments in the code</li>
  <li>Add some test cases to cover cases like what you found.</li>
  <li>I also want to implement this optimization for InListOperator, so
that following queries can use index on REF column, if present.</li>
    <li>select * from t where ref in (?,?,?)</li>
  <li>Then I will start working on trunk to further expand the
optimzation to cover more cases.</li>
Daniel John Debrunner wrote:<br>
<blockquote cite="mid43A20BFB.1050905@debrunners.com" type="cite">
  <pre wrap="">Satheesh Bandaram wrote:

  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">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?

    <pre wrap="">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.
  <pre wrap=""><!---->
I don't think I was clear enough.

&gt;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.



View raw message