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 "Thomas Mueller (JIRA)" <ji...@apache.org> on 2017/06/16 08:51:00 UTC

[jira] [Commented] (OAK-937) Query engine index selection tweaks: shortcut and hint

    [ https://issues.apache.org/jira/browse/OAK-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051608#comment-16051608 ] 

Thomas Mueller commented on OAK-937:
------------------------------------

I think it makes sense to implement this, mainly because different fulltext indexes (depending on the aggregate configuration) can return different results. Let's say there is a fulltext index on "Page" and another on "hierarchyNode" (supertype of Page), with a different aggregate definition. For queries on Page, in theory both indexes can be used.

Instead of hardcoding the exact index to be used, I suggest we use "index tags" (multi-value property "tags" in the index definition). Then the query can use "option(index tagged 'x')" to ensure only indexes with this tag are used. (could be one index only, could be multiple). That way the actual index name doesn't need to be hardcoded in the query. Also, there should be a way to exclude certain indexes, for example using "option(exclude index tagged 'x')" or possibly also "option(exclude index async)" to exclude async index usage.

Another option would be to configure the index to respond / not respond to certain queries. But the risk is that we have to hardcode the actual query, which is not a good idea. And configuring query "shapes" is problematic as well, as queries might change.

> Query engine index selection tweaks: shortcut and hint
> ------------------------------------------------------
>
>                 Key: OAK-937
>                 URL: https://issues.apache.org/jira/browse/OAK-937
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: query
>            Reporter: Alex Deparvu
>            Assignee: Thomas Mueller
>              Labels: performance
>             Fix For: 1.8
>
>
> This issue covers 2 different changes related to the way the QueryEngine selects a query index:
>  Firstly there could be a way to end the index selection process early via a known constant value: if an index returns a known value token (like -1000) then the query engine would effectively stop iterating through the existing index impls and use that index directly.
>  Secondly it would be nice to be able to specify a desired index (if one is known to perform better) thus skipping the existing selection mechanism (cost calculation and comparison). This could be done via certain query hints [0].
> [0] http://en.wikipedia.org/wiki/Hint_(SQL)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)