[ 
https://issues.apache.org/jira/browse/JCR-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544421
 ] 

Ard Schrijvers commented on JCR-1225:
-------------------------------------

Though, when nothing changed in any of the indexes, then the multiReader in 
MultiIndex is still valid, and none of the readers are recreated. When a 
document is added or deleted, a new multiReader  is created by creating all 
ReadOnlyIndexReaders again, but the SharedIndexReader a ReadOnlyIndexReader 
depends on is reused when it did not change. Hence, as you explained in 
JCR-1213, the readersByBase might still be the same. The only thing that must 
be recreated every time is the 'deleted' BitSet, which I am not sure how long 
it takes for *large* indexes. 

You think it is possible to add reuse of the ReadOnlyIndexReaders? 

> ReadOnlyIndexReaders are re-created on every access
> ---------------------------------------------------
>
>                 Key: JCR-1225
>                 URL: https://issues.apache.org/jira/browse/JCR-1225
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: query
>            Reporter: Marcel Reutegger
>            Priority: Minor
>
> AbstractIndex.getReadOnlyIndexReader() creates a new instance on every call. 
> The returned index reader should instead be cached and kept open as long as 
> there are no changes on the underlying index.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to