[ 
https://issues.apache.org/jira/browse/JCR-1337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561627#action_12561627
 ] 

Ard Schrijvers commented on JCR-1337:
-------------------------------------

That is a quick you patch have there :-) 

Looks like a useful optimization, i only have concerns in its current form:

IIUC, merging of 2 indexes also introduces a new CachingIndexReader: if the new 
formed index is *large*, initializeParents(delegatee) might consume a lot of 
time and cpu. Therefor a background thread (with low priority) might be better, 
or would this again impose synchronization problems perhaps?

Also, since this patch is only pre-warming newly created CachingIndexReaders, 
and initializes its parents, it does still imply slow uncached queries when 2 
large indexes merge and create a new CachingIndexReaders. These two indexes 
might contains *many parents* of lucene docs residing in other segments, which 
obviously are not re-warmed (strange non-existing word, but hopefully clear :-) 
), so still having not the hierarchical cache up2date.

Think this patch is an improvement, but does not cover the entire pre-warming 
issue and might lead to hickups for large index merges. 

Perhaps a nonstop background thread with low priority from time to time 
updating the hierarchical cache would be more efficient. OTOH, with low 
priority threads we are pretty much jvm dependant on how they are handled, 
isn't? 

WDYT?

> Optimize first execution queries for DescendantSelfAxisWeight/ChildAxisQuery
> ----------------------------------------------------------------------------
>
>                 Key: JCR-1337
>                 URL: https://issues.apache.org/jira/browse/JCR-1337
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: query
>    Affects Versions: 1.4
>            Reporter: Ard Schrijvers
>             Fix For: 2.0
>
>         Attachments: JCR-1337.patch
>
>
> The first execution of a query involving 
> DescendantSelfAxisWeight/ChildAxisQuery is slow. Consecutive queries are 
> faster because the hierarchy is cached

-- 
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