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

Vladimir Ozerov commented on IGNITE-5482:
-----------------------------------------

[~al.psc], my comments:
1) Unused imports
2) {{IgniteH2Indexing.store|remove}} - looks like cache is cleared before 
update. It means, that you can re-cache stale data before update, and thus get 
stale results.
3) Should state be cleared during DDL commands execution?
4) I think it is better to have boolean flag on per-query basis, rather than 
global configuration. It should be {{false}} by default.
5) Looks like {{AtomicReference}} is not needed. Instead, we should iterate 
over wrappers and mark them invalid.
6) I do not understand the purpose of {{GridMapQueryExecutor#absolute}} method. 
All we need is to track current position, and simply copy some rows from 
existing List with results to passed List, aren't we?
7) You never clear the cache except of updates. This is a memory leak. At the 
moment cached query result should be cleared when there are no more active 
readers. It should work as follows:
- Initially RS is created with counter == 1
- If another reader joins, it is CAS from positiive value to value+1;
- When reader finishes, counter is decremented
- Or when remote node reading result leaves topology, counter is decremented
- When counter reaches zero, try CASing it from 0 to -1. If successful - result 
set can be removed from the map

> Implement basic caching of query results
> ----------------------------------------
>
>                 Key: IGNITE-5482
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5482
>             Project: Ignite
>          Issue Type: Task
>          Components: sql
>    Affects Versions: 2.0
>            Reporter: Alexander Paschenko
>            Assignee: Alexander Paschenko
>              Labels: important
>             Fix For: 2.2
>
>
> Sergi suggested that we reuse results of the same queries running 
> simultaneously - i.e. if a query is being executed with the same arguments 
> and flags again and again, there's no need to do actual querying of data, 
> instead we can really run query once while other simultaneous runs will wait 
> for those results.
> This strategy will be implemented on MAP stage of distributed query.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to