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: Performance of join SQL queries
Date Mon, 10 Aug 2015 07:28:48 GMT

1) Just prepend your query with EXPLAIN and run it as usual.
For example: EXPLAIN SELECT count(*) FROM t WHERE x = ?

2) Yes, indexes are sorted. It means that they will be used for range
Basically condition `x = 10` is equivalent to `x between 10 and 10`.

3) It is not a requirement that a field participating in condition like `>`
must be
in the end of indexing group, but this way query may work faster, because
previous conditions are bounded on both sides and the last one will be only
half-bounded. If you will have a half-bounded field in the middle of
indexing group then you'll make all the fields going after in indexing group
half-bounded as well even if conditions on them are fully bounded.
So definitely it is preferable.

On the other hand if first fields in the indexing group already have a good
then you will not win much by putting this half-bounded field in the end of
indexing group,
you can put it it in the middle as well, or even not index it at all.
Just try and look what works for your data and your queries better.


2015-08-10 9:12 GMT+03:00 alex.glau <alex.glau@gmail.com>:

> Hi Sergi,
> Thanks for clear explanation.
> 1) Can you either post syntax of EXPLAIN query or give me a reference to
> appropriate documentation
> 2) If we have index on field representing Date (or Float or Integer), does
> it help in queries with criteria like date > AnyFixDate (or number >
> AnyFixNumber)?
> 3) If answer on the previous question is Yes and we prepare compound index
> that should include Date (or Float or Integer) field, have this field be
> located in the last position inside the indexing group? If so what about
> the
> case where we have more than one such field?
> Regards,
> Alex.
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Performance-of-join-SQL-queries-tp845p878.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message