HI Val,
I was trying to do following
select * from Person p where p.id in ('1', '3') OR name in ('name0',
'name1') order by id
both id and name fields are indexed.
As IN query does not use index as per
http://apacheignite.gridgain.org/docs/sql-queries#performance-and-usability-considerations
i have written the above query -
select * from (
select * from Person p join table(joinId varchar(10) = ?) i on p.id =
i.joinId
UNION
select * from Person p join table(name varchar(10) = ?) i on p.id = i.name
) order by id
But above query is not using index at all. union is index without our query.
Please let me know if there are any workarounds to index in case of
multiple INs with OR.
Thanks.
On 28 October 2016 at 01:18, vkulichenko <[email protected]>
wrote:
> Hi,
>
> You can join multiple virtual tables in the same way:
>
> select p.name from Person p
> join table(id bigint = ?) i on p.id = i.id
> join table(name bigint = ?) j on p.name = j.name
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/IN-Query-tp8551p8562.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>