|
Any chance this fix can be backported to the 2.1.x branch?
Yes, it will be done this week.
But please note that performance may suffer in your case. Usually, hints (field || '' in your case) are used to disable a single index of a few ones chosen by the optimizer, or to change the join order. But you seem to disable the only one suitable index and the plan changes from JOIN to MERGE. Once this fix is backported, the MERGE plan will no longer be possible and the resulting effect would be a JOIN plan again, but this time a not-indexed one, which effectively means a cartesian join. It will be terribly slow.
I hope your real situation is somewhat different. Otherwise, I'd rather suggest to either use hints properly (|| '' for strings and + 0 for numerics) or find some alternative solution. Thanks for the quick response!
I am very glad the fix will be backported. We will probably need to go use +0 anyway, but I am very relieved that places we may overlook/forget just turn slow instead of unnoticeably return bad results. By the way: I've just tested the current snapshot of 3.0 Alpha (8 dec 2010), and can confirm that the fix works for both Backported into v2.5.1 and v2.1.4.
|
Moving from 2.0 to 2.1: This bug is a nasty one for 2.0 systems which were built on the assumption that implicit type casts in join comparisons give correct results, even if this only happened because the varchar column was indexed and no MERGE plan was used.
2.1 doesn't use the index in those situations. For those systems, upgrading to 2.1 therefore means reviewing all statements and updating part of them. Not exactly a blocker, but close.