ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "slava.koptilin" <slava.kopti...@gmail.com>
Subject Re: index for like criteria
Date Fri, 19 Jan 2018 12:41:40 GMT
Hi Rajesh,

> If I execute the following query , will the index would be applied on the
> name field?
Well, the answer is depended on the position of the wildcard character.
For example, if filter pattern does not use the wildcard character (%) at
the very beginning of the filter ("organization%") then SQL engine can use
the characters before the first wildcard during filtering and so, the index
can be used.
In the opposite case (filter expression starts from %), the index cannot be
used and SQL engine has to scan the entire table.

You can check the plan of execution of your SQL expression with EXPLAIN.
    explain select * from table where name like 'organization%';
the output will contain something like as follows:
FROM ...
PUBLIC.TABLE_FIELD_IDX: NAME >='organization' <-- this line indicates that
index was used


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

View raw message