dynamobi/dynamobi — Issue #428: [FRG-380] Optimizer does not treat 'col=v1 OR col=V2 OR ...' same as 'col IN (v1, v2, ...)'
Author: dynamobi-build
Created: 2011-12-30 03:13:29+00:00
State: open
Labels: FRG, Optimization rules

[reporter="jhyde", created="Mon, 17 Aug 2009 16:56:45 -0500 (GMT-05:00)"]
Optimizer does not treat 'col=v1 OR col=V2 OR ...' same as 'col IN (v1, v2, ...)'.

In particular there is a rule that optimizes large IN lists to in-memory tables, and it does not apply if you write the query using OR.

See email thread http://n2.nabble.com/Size-limits-for-query--td3459145.html

JVS wrote, "Recognizing the OR form and converting to IN could be done via its own

optimizer rule, which would also handle OR/AND for compound keys.

However, there are lots of possible variations here (IS NULL, other

kinds of predicates mixed in), so it's an open-ended task."