[ 
https://issues.apache.org/jira/browse/IGNITE-12189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16948677#comment-16948677
 ] 

Andrey Mashenkov commented on IGNITE-12189:
-------------------------------------------

Thanks.
I've just found you apply 'limit' on reduce side inside CacheQueryFutureAdapter.

Assume, you have few nodes, small pageSize (10 entries per page) and large 
enough 'limit' = 1000.
So, you'll get about 100 pages from every node and about 1000 in total, but 
most likely you want only first 100 pages.

For now query initiator node sends 1 GridCacheQueryRequest and can get multiple 
GridCacheQueryResponse-s per remote.
TextQuery processing finishes when all remotes send GridCacheQueryResponse with 
'finished' flag.
Seems, TextQuery processing  should be reworked like it was done for SQL 
queries.

Ignite has GridQueryNextPageRequest \ Response classes for SQL result 
processing.
Similar processing should be implemented for TextQueries. 
This looks like a big change which allow us to add correct sorting and apply 
limit correctly on reduce . 

Let's create a separate ticket for this and link it to current one, then I'll 
merge PR to master.



> Implement correct limit for TextQuery
> -------------------------------------
>
>                 Key: IGNITE-12189
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12189
>             Project: Ignite
>          Issue Type: Improvement
>          Components: general
>            Reporter: Yuriy Shuliha 
>            Assignee: Yuriy Shuliha 
>            Priority: Major
>             Fix For: 2.8
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> PROBLEM
> For now each server-node returns all response records to the client-node and 
> it may contain ~thousands, ~hundred thousands records.
>  Event if we need only first 10-100. Again, all the results are added to 
> queue in _*GridCacheQueryFutureAdapter*_ in arbitrary order by pages.
>  There are no any means to deliver deterministic result.
> SOLUTION
>  Implement _*limit*_ as parameter for _*TextQuery*_ and 
> _*GridCacheQueryRequest*_ 
>  It should be passed as limit  parameter in Lucene's  
> _*IndexSearcher.search()*_ in _*GridLuceneIndex*_.
> For distributed queries _*limit*_ will also trim response queue when merging 
> results.
> Type: long
>  Special value: : 0 -> No limit (Integer.MAX_VALUE);



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to