[ https://issues.apache.org/jira/browse/OAK-6350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16076378#comment-16076378 ]
Chetan Mehrotra commented on OAK-6350: -------------------------------------- Duplicate plan name is actually already fixed in OAK-4652 > Improve log reporting if multiple indexes compete for same query > ---------------------------------------------------------------- > > Key: OAK-6350 > URL: https://issues.apache.org/jira/browse/OAK-6350 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: query > Reporter: Chetan Mehrotra > Priority: Minor > Fix For: 1.8 > > > Currently if multiple indexes compete for same query i.e. they report cost > > 0 and less than infinity then the log output is confusing. For e.g. for a > query like > {noformat} > QueryEngineImpl Parsing xpath statement: /jcr:root/content/dam//element(*, > dam:Asset)[jcr:contains(., 'foo.png')] > QueryEngineImpl XPath > SQL2: select [jcr:path], [jcr:score], * from > [dam:Asset] as a where contains(*, 'foo.png') and isdescendantnode(a, > '/content/dam') /* xpath: /jcr:root/content/dam//element(*, > dam:Asset)[jcr:contains(., 'foo.png')] */ > QueryImpl cost using filter Filter(query=select [jcr:path], [jcr:score], * > from [dam:Asset] as a where contains(*, 'foo.png') and isdescendantnode(a, > '/content/dam') /* xpath: /jcr:root/content/dam//element(*, > dam:Asset)[jcr:contains(., 'foo.png')] */ fullText="foo.png", > path=/content/dam//*) > QueryImpl cost for aggregate lucene is 2.2424751E7 > QueryImpl cost for lucene-property[/oak:index/index-a][/oak:index/index-b] is > 146914.0 > QueryImpl cost for reference is Infinity > QueryImpl cost for ordered is Infinity > QueryImpl cost for nodeType is Infinity > QueryImpl cost for property is Infinity > QueryImpl cost for traverse is Infinity > QueryImpl query execute select [jcr:path], [jcr:score], * from [dam:Asset] as > a where contains(*, 'foo.png') and isdescendantnode(a, '/content/dam') /* > xpath: /jcr:root/content/dam//element(*, dam:Asset)[jcr:contains(., > 'foo.png')] */ > QueryImpl query plan [dam:Asset] as [a] /* lucene:index-b(/oak:index/index-b) > +(((...) +:ancestors:/content/dam ft:("foo.png") where (contains([a].[*], > 'foo.png')) and (isdescendantnode([a], [/content/dam])) */ > QueryImpl query execute select [jcr:path], [jcr:score], * from [dam:Asset] as > a where contains(*, 'foo.png') and isdescendantnode(a, '/content/dam') /* > xpath: /jcr:root/content/dam//element(*, dam:Asset)[jcr:contains(., > 'foo.png')] */ > QueryImpl query plan [dam:Asset] as [a] /* lucene:index-b(/oak:index/index-b) > +(((...)) +:ancestors:/content/dam ft:("foo.png") where (contains([a].[*], > 'foo.png')) and (isdescendantnode([a], [/content/dam])) */ > {noformat} > Here both index-a and index-b satisfy the query. However from logs it appears > that both have same cost. While actually the reported cost is the lowest one > which in this case would be for index-b > {noformat} > QueryImpl cost for lucene-property[/oak:index/index-a][/oak:index/index-b] is > 146914.0 > {noformat} > So as a fix > * Report cost for multiple plans returned by same index type separately > * If cost is less than infinity and that plan is eventually not selected then > also log its plan. This would help to see why specific plan lost -- This message was sent by Atlassian JIRA (v6.4.14#64029)