|Subject||RE: [firebird-support] Re: Why does the optimizer choose NATURAL for this tiny table?|
> 13.11.2014 14:39, Svein Erling Tysvær wrote:Dmitry,
> > D1) ON p.icd10 = t.icd10
> > These change the plan to:
> > PLAN JOIN (MERGE (SORT (JOIN (P NATURAL, G INDEX
> > (I_ICD10_GRUPPE_ICD10))), SORT (JOIN (T KID INDEX
> > T N INDEX (I_NPR_KRG_ID), T T INDEX (I_NPR_TILSTAND_ID_NPR)))), I
> > INDEX (PK_ICD10))
> Interesting. The only possible explanation is that the datatypes for
> P.ICD10 and T.ICD10 differ. ICD10 is an expression inside T, so its hard to say
> what the resulting data type is.
Do you think that a CAST() within T would help?
What are the p.icd10 and t.icd10 datatypes?