I like Marcel proposal for "enforcing" use of mixin on parent node to
indicate that it can have a child node of 'oak:index'. So we can
leverage mxin 'mix:indexable' (OAK-3725) to mark such parent nodes
(like root) and IndexUpdate would only look for 'oak:index' node if
current node has that mixin.

This would avoid the extra calls. For new setups we can enforce this
and for upgrade we can migrate the existing code by using nodetype
index to update all such "indexable" nodes
Chetan Mehrotra


On Thu, Feb 23, 2017 at 4:47 PM, Chetan Mehrotra
<chetan.mehro...@gmail.com> wrote:
> On Wed, Feb 22, 2017 at 8:21 PM, Davide Giannella <dav...@apache.org> wrote:
>> Did you mean for ALL the nodes, or only specific nodes?
>>
>> Any way you're suggesting something like the following flow:
>>
>> 1) user call nodebuilder.child(":index")
>> 2) lookup in hidden property
>> 3) if not there, leverage the existing code
>>
>> If so I guess the property has been already fetched and it does not
>> require roundtrips towards the DB. Am I right?
>
> Currently the lookup is being done for ALL nodes. So IndexUpdate class
> does following on each changed node
>
> ------
>>     @Override
>     public void enter(NodeState before, NodeState after)
>             throws CommitFailedException {
>         collectIndexEditors(builder.getChildNode(INDEX_DEFINITIONS_NAME),
> before);
> ------
>
> Which transalates into checking if the current node has a child node
> 'oak:index' and this leads to redudant calls.
>
> Chetan Mehrotra

Reply via email to