Thank you, sir!!! YOu are right it does help, but in a way that
supirises me (I tried OR before but got the second result below):

This query now runs super fast, <15ms (sweet!!!):
SELECT objId,b FROM om WHERE
(b=1 OR b=2)
AND objId IN (1254619816788000000,1176099280681000000)

But this query still takes >10 seconds:
SELECT objId,b FROM om WHERE
(b=1 OR b=2)
AND (objId=1254619816788000000 OR objId=1176099280681000000)

Will your solution account for this difference also?

Again many thanks!!!

Ken

On Feb 24, 11:12 pm, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> I found the problem, it will be fixed in the next release. The index
> is currently not used if there were multiple IN(..) conditions. A
> workaround is to use OR:
>
> SELECT pk FROM om WHERE pk IN (<BIGINT-LIST>) AND (b = 1 OR b = 2)
>
> The query plan is not very clear. I will change that as well, so that
> the query plan will contain ".tableScan" if a table scan is used.
>
> Regards,
> Thomas

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

Reply via email to