[
https://issues.apache.org/jira/browse/OAK-6867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16256900#comment-16256900
]
Thomas Mueller commented on OAK-6867:
-------------------------------------
The test uses 60 property indexes by default, while I think more realistic are
about 10 (I got that data running the following query: {{/jcr:root//element(*,
oak:QueryIndexDefinition)\[@type = 'property'\]}}). My test results (and I'm
only looking at "N"):
{noformat}
(no hint)
java -DnoOfIndex=10 -jar target/oak-benchmarks-1.8-SNAPSHOT.jar benchmark
UUIDLookupTest Oak-Segment-Tar
# UUIDLookupTest C min 10% 50% 90% max
N
No of indexes (10) 10, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
Oak-Segment-Tar 1 2 3 3 4 14
17887
java -DnoOfIndex=35 -jar target/oak-benchmarks-1.8-SNAPSHOT.jar benchmark
UUIDLookupTest Oak-Segment-Tar
# UUIDLookupTest C min 10% 50% 90% max
N
No of indexes (35) 35, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
Oak-Segment-Tar 1 4 4 5 6 18
11946
java -DnoOfIndex=60 -jar target/oak-benchmarks-1.8-SNAPSHOT.jar benchmark
UUIDLookupTest Oak-Segment-Tar
# UUIDLookupTest C min 10% 50% 90% max
N
No of indexes (60) 60, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
Oak-Segment-Tar 1 5 6 7 8 62
8796
(with hint)
java -DFAST=true -DnoOfIndex=10 -jar target/oak-benchmarks-1.8-SNAPSHOT.jar
benchmark UUIDLookupTest Oak-Segment-Tar
# UUIDLookupTest C min 10% 50% 90% max
N
No of indexes (10) 10, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
Oak-Segment-Tar 1 2 2 3 3 13
22280
java -DFAST=true -DnoOfIndex=35 -jar target/oak-benchmarks-1.8-SNAPSHOT.jar
benchmark UUIDLookupTest Oak-Segment-Tar
# UUIDLookupTest C min 10% 50% 90% max
N
No of indexes (35) 35, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
Oak-Segment-Tar 1 2 3 3 4 9
18793
java -DFAST=true -DnoOfIndex=60 -jar target/oak-benchmarks-1.8-SNAPSHOT.jar
benchmark UUIDLookupTest Oak-Segment-Tar
# UUIDLookupTest C min 10% 50% 90% max
N
No of indexes (60) 60, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
Oak-Segment-Tar 1 2 3 3 4 15
17040
{noformat}
So with 10 property indexes, the differences seems to be still there, but not
as much.
[~catholicon] as far as I understand, "getNode" means getNodeByIdentifier,
which runs the query with the hint.
And "query" is the original query without the hint. That explains why there is
no difference there. I think this test isn't relevant.
> Enable index hints on UUID lookup query
> ---------------------------------------
>
> Key: OAK-6867
> URL: https://issues.apache.org/jira/browse/OAK-6867
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: query
> Reporter: Alex Deparvu
> Assignee: Thomas Mueller
> Fix For: 1.8
>
>
> For the UUID lookup query I enabled the (recently added) query hints support
> where you can specify the index you want to be used and I got an interesting
> speedup in the benchmarks:
> {noformat}
> Hint disabled, lookup by query
> # UUIDLookupTest C min 10% 50% 90% max
> N
> No of indexes (60) 60, Lookup by (lookupByQuery)[query]
> Oak-Segment-Tar 1 5 5 6 7 27
> 9837
> Hint enabled, lookup by query
> # UUIDLookupTest C min 10% 50% 90% max
> N
> No of indexes (60) 60, Lookup by (lookupByQuery)[query]
> Oak-Segment-Tar 1 5 5 6 7 13
> 10128
> Hint enabled, lookup by getNode
> # UUIDLookupTest C min 10% 50% 90% max
> N
> No of indexes (60) 60, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
> Oak-Segment-Tar 1 5 6 6 7 13
> 9447
> Hint disabled, lookup by getNode
> # UUIDLookupTest C min 10% 50% 90% max
> N
> No of indexes (60) 60, Lookup by (lookupByQuery)[Session#getNodeByIdentifier]
> Oak-Segment-Tar 1 3 3 3 4 8
> 17504
> {noformat}
> It seems the cost shortcut is reducing the overall time, but cannot say for
> sure where this change comes from.
> The only change I did was to add {{option(index name uuid)}} to this query [0]
> [~tmueller], [~chetanm] what do you think?
> [0]
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java#L356
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)