db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Commented: (DERBY-649) Useful indexes not used in UNION ALL
Date Thu, 15 Dec 2005 08:19:17 GMT
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 <ColumnReference> <RELOP> <constant>. 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  <ColumnReference> <RELOP> <constant>, 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.


Mime
View raw message