ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Kuznetsov <akuznet...@apache.org>
Subject Re: Sort queries are slow
Date Tue, 04 Apr 2017 10:42:02 GMT
Sergi,

May be it is worth to also add this advice on [1] ?

[1] https://apacheignite.readme.io/docs/indexes


On Tue, Apr 4, 2017 at 4:58 PM, Sergi Vladykin <sergi.vladykin@gmail.com>
wrote:

> You should create a group index on (A, B) and rewrite the query the
> following way:
>
> select * from Test where A = '<something>'  order by A, B
>
> Semantically it will be the same, but it will use index (A, B) for search
> and sorting.
>
> Sergi
>
> 2017-04-04 12:18 GMT+03:00 Anil <anilklce@gmail.com>:
>
>> HI,
>>
>> i have created a table with columns A and B. A is indexed column. and use
>> following queries
>>
>> 1. select * from Test where A = '<something>'
>> 2. select * from Test where A = '<something>'  order by B
>>
>> #1 is fast as it uses default sorting of indexed column A. But #2 is slow.
>>
>> Do you think creating index on B will speed up #2 query ? i tried that as
>> well and no luck.
>>
>> are there any ways to improve the performance of #2 ? please advise.
>>
>> Thanks
>>
>>
>


-- 
Alexey Kuznetsov

Mime
View raw message