You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2017/07/07 04:57:00 UTC

[jira] [Resolved] (OAK-6350) Improve log reporting if multiple indexes compete for same query

     [ https://issues.apache.org/jira/browse/OAK-6350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chetan Mehrotra resolved OAK-6350.
----------------------------------
       Resolution: Fixed
         Assignee: Chetan Mehrotra
    Fix Version/s: 1.7.4

> 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
>            Assignee: Chetan Mehrotra
>            Priority: Minor
>              Labels: candidate_oak_1_2, candidate_oak_1_4, candidate_oak_1_6
>             Fix For: 1.8, 1.7.4
>
>
> 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)