This was already discussed some time ago. A working workaround is to use

    (SELECT ..) UNION (SELECT ...)

instead of OR.

On Tue, Oct 2, 2012 at 6:57 PM, BrianR <brian....@gmail.com> wrote:

If column a is index and running a query of
>
> SELECT * FROM tableFoo WHERE a = 'value' OR a LIKE 'value2'
>
> does not use the index on a.
>
> I also noticed the following query does not use an index
>
> SELECT * FROM tableFoo WHERE a = 'value' OR 1=1
>
> This may be by design but probably should be documented somewhere.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/h2-database/-/GjKh5-2c-H4J.
> To post to this group, send email to h2-database@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
>
-- 
   Vasile Rotaru

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-database@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to