ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergi Vladykin <sergi.vlady...@gmail.com>
Subject Re: Re[2]: Polymorphic SQL queries
Date Tue, 27 Dec 2016 14:37:06 GMT
You can look at the following example with binary objects and SQL queries:
[1]

Ok, you are more precise :) I treated `SELECT * FROM Person, City` as INNER
join without a predicate, because implementationwise they are the same
thing. If you have indexes on joined fields query will work faster.

Sergi

[1]
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryQueryExample.java


2016-12-27 16:31 GMT+03:00 Mikhail Fokanov <wmaster@mail.ru>:

> Thanks a lot, Sergi. I store the data in the same cache. Could you explain
> a little more extensively, what should I change in configuration of cache
> in order to use Binary types of different structure with the same binary
> type?
>
> About CROSS join: I mean that queries like SELECT * FROM Person, City is
> cross joins (https://ru.wikipedia.org/wiki/Join_(SQL)#CROSS_JOIN)
>
> --
> Best Regards,
> Mikhail Fokanov
>
> Вторник, 27 декабря 2016, 15:13 +03:00 от Sergi Vladykin <
> sergi.vladykin@gmail.com>:
>
>
> Hi,
>
> Right now I see only one way to store different value types in the same
> SQL table: you can use Binary types of different structure with the same
> binary type and store them in the same cache.
>
> I did not find anything about CROSS joins in our docs, may be you have
> confused it with cross-cache join? Because we actually do support INNER and
> OUTER joins.
>
> Sergi
>
> 2016-12-27 14:48 GMT+03:00 Mikhail Fokanov <wmaster@mail.ru>:
>
> Hi,
>
>                I use Apache Ignite for high-loaded portal. Performance of
> SQL queries are ok, but I can't find a way of implementing polymorphic SQL
> queries. I need to index all sub-classes of the class in SINGLE_TABLE
> strategy (ex. ImageFile, PdfFile as sub-classes of File), in order to
> execute queries like (select * from File where createdDate > 0). For such
> query I can use "union all" and search all sub-classes, but now the amount
> of sub-classes is 15 and this solution looks bad. Also I need to join User
> table with File table and I think "union all" will be bad for performance
> in such case. Am I right? I try to manage Query Entities in
> CacheConfiguration, but have no success. Can I implement some hack to store
> entities of all sub-classes in the same table (File) and execute queries on
> it?
>                Also I mention that in guide (http://apacheignite.gridgain.
> org/docs/sql-queries) sql joins are always CROSS. Can I use INNER joins
> and does it improve the performance of query?
>
> --
> Best Regards,
> Mikhail Fokanov
>
>
>
>

Mime
View raw message