-
1. Re: Optimizer and over constraining
shawkins Mar 16, 2017 4:27 PM (in response to damien_b)> Is there a way to hint the optimizer to not add the extra constraint?
What version are you on?
It may be possible to suppress this in situations where the inner join is retained - in other cases this would simply be represented by a cross join in which case each of the predicates is needed.
-
2. Re: Optimizer and over constraining
damien_b Mar 16, 2017 7:58 PM (in response to shawkins)I'm on 9.2.0.Final.
I've made a mistake in the original post, the right queries are:
- SELECT * FROM a inner join b ON a.x=b.y WHERE a.x='v'
- optimized as: SELECT <columns> FROM a INNER JOIN b WHERE a.x=b.y AND a.x='v' AND b.y='v'
So the inner join is retained, next time I should copy paste directly..
-
3. Re: Optimizer and over constraining
damien_b Mar 17, 2017 8:24 AM (in response to shawkins)So, any idea? :-)
-
4. Re: Optimizer and over constraining
shawkins Mar 17, 2017 8:33 AM (in response to damien_b)As to a workaround you mean? No. This would likely require a code change.
-
5. Re: Optimizer and over constraining
damien_b Mar 20, 2017 4:43 AM (in response to shawkins)Yes, a workaround: if something could be configured in the "capabilities" to avoid the extra condition.
-
6. Re: Optimizer and over constraining
shawkins Mar 20, 2017 11:19 AM (in response to damien_b)No, the only thing you could do at the translator level would be to check for this situation in the predicates and omit the ones you don't want. It would take an engine change to not push the extra predicate in the first place.
-
7. Re: Optimizer and over constraining
shawkins Jun 5, 2017 4:30 PM (in response to shawkins)Logged [TEIID-4943] Allow translators to declare if copied criteria should be included - JBoss Issue Tracker to capture this as an engine issue.