You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Aurora <25...@qq.com> on 2017/11/19 13:34:45 UTC

what's best practice of “in” operator?

Ignite 2.2:

common sql:  select p.* from  "personCache".Person p join 
"OrganizationCache".Organization o on p.org_id = o.id
where o.area in ('london','paris','roma',...)


Is there the better sql  from performance perspective?

thanks.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: what's best practice of “in” operator?

Posted by Alexey Kukushkin <ku...@gmail.com>.
Hi,

The "table" in documentation is a keyword "table" to create a temporary
table. Your query shall be like

SELECT p.* FROM  "personCache".Person p join table(area varchar
=('london','paris','roma',...))
o
on p.org_id = o. <http://o.id/>area

Re: what's best practice of “in” operator?

Posted by Aurora <25...@qq.com>.
Thank @ezhuravlev.

Following the above document, I tried it with:

SELECT p.* FROM  "personCache".Person p join 
"OrganizationCache".Organization(area String =('london','paris','roma',...))
o 
on p.org_id = o.id

But It failed,  the error log was like : Failed to parse query....
Caused by: org.h2.jdbc.JDBCSQLException: Function "Organization" not found.

how to fix this sql?







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: what's best practice of “in” operator?

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,

it should be replaced with joins. Find more information here:

https://apacheignite-sql.readme.io/docs/performance-and-debugging#section-sql-performance-and-usability-considerations

Evgenii

2017-11-19 16:34 GMT+03:00 Aurora <25...@qq.com>:

> Ignite 2.2:
>
> common sql:  select p.* from  "personCache".Person p join
> "OrganizationCache".Organization o on p.org_id = o.id
> where o.area in ('london','paris','roma',...)
>
>
> Is there the better sql  from performance perspective?
>
> thanks.
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>