ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: Ignite: QuerySqlField - index question
Date Mon, 13 Jun 2016 07:49:52 GMT

Yes, your initial understanding is absolutely correct: if a field is not exposed as QuerySqlField
then you won’t be able to use it in both “SELECT” and “WHERE” clauses of a query.
When a field is used in the “WHERE” clause (“select … where myField = 10”) then
it makes sense to make it an indexed field (index=true) especially if data set is significant.
Indexes allow to complete queries in O(logn) time. Without indexes a full scan will happen
that corresponds to O(n) running time complexity.

You can index all the primitives and your custom objets. However there is no sense trying
to index map, arrays, collections because indexing capabilities are not supported for them.


> On Jun 11, 2016, at 1:47 PM, M Singh <mans2singh@yahoo.com> wrote:
> Hi Folks:
> A newbie question - I believe using QuerySqlField annotation exposes a field for queries.
 If a field does not have the annotation we won't be able to query it.  But I am not sure
what is the purpose and implication of using with and without an index parameter ?  Here is
an example snippet from documentation :
> /** Person ID (indexed). */
>   @QuerySqlField(index = true)
>   private long id;
>   /** First name (not-indexed). */
>   @QuerySqlField
>   private String firstName;
> How does it work internally, ie, how does it change storage, location, query processing
?  What are the types of fields we can index ?
> Thanks

View raw message