Multi-dimensional index

classic Classic list List threaded Threaded
5 messages Options
alex.glau alex.glau
Reply | Threaded
Open this post in threaded view
|

Multi-dimensional index

H2 database, the Ignite is based on, supports multi-dimensional indexes, so we can create something like:
CREATE INDEX INDEX_PLACE ON ADDRESS(CITY, NAME, FIRST_NAME);
Such index enables searching by CITY, by CITY and NAME, by CITY, NAME and FIRST_NAME.
Does Ignite support this feature?
Alexey Kuznetsov Alexey Kuznetsov
Reply | Threaded
Open this post in threaded view
|

Re: Multi-dimensional index

Alex,

Ignite support compound indexes, see javadocs for @QuerySqlField.groups().

But I think we should add a description (with examples) how to use compound indexes to https://apacheignite.readme.io/docs/cache-queries



On Sun, Aug 9, 2015 at 7:26 PM, alex.glau <[hidden email]> wrote:
H2 database, the Ignite is based on, supports multi-dimensional indexes, so
we can create something like:
CREATE INDEX INDEX_PLACE ON ADDRESS(CITY, NAME, FIRST_NAME);
Such index enables searching by CITY, by CITY and NAME, by CITY, NAME and
FIRST_NAME.
Does Ignite support this feature?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Multi-dimensional-index-tp872.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.



--
Alexey Kuznetsov
GridGain Systems
www.gridgain.com
alex.glau alex.glau
Reply | Threaded
Open this post in threaded view
|

Re: Multi-dimensional index

Hi Alexey,
Thank you (спасибо) for quick reply. Can you meanwhile post simple example of compound index usage just here.
Regards, Alex.
alex.glau alex.glau
Reply | Threaded
Open this post in threaded view
|

Re: Multi-dimensional index

In reply to this post by Alexey Kuznetsov
Hi Alexey,

If I add some field to grouping index by using annotation  @QuerySqlField.Group do I need add also annotation @QuerySqlField(index = true) or these two annotations are independent?

Regards,
Alex.
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Multi-dimensional index

Alex,

@QuerySqlField(index = true) should be used if you need an individual index for the field. If the field participates only in compound indexes, you can leave it as false.

-Val