Which oak:index is being used? | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MC_Stuff

Hi Tom,

Always grep for "query plan".  In your above example it is using property index oclc_start.

Thanks,

3 replies

MC_Stuff
Level 10
June 12, 2017

Hi Tom, 

Explain query tool provide the information you are looking Operations Dashboard  ,   enable debug log on [A] will let you see in log file but will have more additional  info.

[A]

org.apache.jackrabbit.oak.plugins.index

org.apache.jackrabbit.oak.query

Thanks,

Level 4
June 14, 2017

I created a logger for the above. I am not easily able to identify the index being used in a query.

For instance here are two entries from the log. What index is being used?

14.06.2017 08:12:27.612 *DEBUG* [0:0:0:0:0:0:0:1 [1497442347171] GET

/content/research/events/events.html HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl query

execute select [jcr:path], [jcr:score], * from [cq:CalendarEvent] as a where [event_tag] like

'research:events' and [start] <= cast('2017-06-13T23:59:59.520-04:00' as date) order by [start] desc

/* xpath: //element(*, cq:CalendarEvent)[(((jcr:like(@event_tag, 'research:events'))) and ((@start

<= xs:dateTime('2017-06-13T23:59:59.520-04:00'))))] order by @start descending */

14.06.2017 08:12:27.612 *DEBUG* [0:0:0:0:0:0:0:1 [1497442347171] GET /content/research/events/events.html

HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl query plan [cq:CalendarEvent] as [a] /* property

oclc_start IS NOT NULL where ([a].[event_tag] like 'research:events') and ([a].[start] <=

cast('2017-06-13T23:59:59.520-04:00' as date)) */

MC_Stuff
MC_StuffAccepted solution
Level 10
June 15, 2017

Hi Tom,

Always grep for "query plan".  In your above example it is using property index oclc_start.

Thanks,