I thought, what if I can influence the order of index conditions. I noticed 
that the order of conditions can change the optimizer. It always reorder 
index conditions and IN matches are always second.

четверг, 19 октября 2017 г., 13:54:27 UTC+3 пользователь Noel Grandin 
написал:
>
>
>
> On 2017/10/19 11:15 AM, Дмитрий Лукьяненко wrote: 
> > I agree that X=? condition will produce less rows than X IN(..). But I 
> doesn't agree that X=? will produce less rows 
> > than Y IN (..). This condition excludes IN values from Row. 
> > 
>
> Hmmm, We have the USE INDEX thing which forces use of an index, but it 
> won't work in this case, because it's HOW we're 
> using the index that is a problem. 
>
> The code is in general correct, but only for a single-column index. If we 
> have a multi-column index and the IN matches 
> the first part of the index, and the X=? matches later parts of the index, 
> then the code is wrong. 
>
> Could you produce a standalone test case that illustrates that? And log a 
> bug (or reopen the one I closed) with that 
> standalone test case. 
>
> Then I might be able to tweak the code for this situation. 
>
> Regards, Noel. 
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to