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 2016/10/05 07:12:20 UTC

[jira] [Commented] (OAK-4888) Warn or fail queries above a configurable cost value

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

Thomas Mueller commented on OAK-4888:
-------------------------------------

This is a nice feature, even thought it might be a bit tricky to get right (avoid false positives, and catch all bad cases).

We could log warnings if no good index is available, so traversing has to be used. There could be false positives, for example queries that traverse a small, limited number of nodes (queries with a tight path constraint).

We could log warnings if an index is available, but only a very broad one (for example just the nodetype index, for nodetypes that are common). The question is, how can the query engine decide which nodetypes / values for a property are common (in an almost empty repository).

Configuration could be done similar to how we can configure the maximum number of read rows (QueryEngineSettings).



> Warn or fail queries above a configurable cost value
> ----------------------------------------------------
>
>                 Key: OAK-4888
>                 URL: https://issues.apache.org/jira/browse/OAK-4888
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: query
>            Reporter: Alexander Klimetschek
>            Assignee: Thomas Mueller
>             Fix For: 1.6
>
>
> *Problem:* It's easy to run into performance problems with queries that are not backed by an index or miss the right one. Developers writing these queries typically do not have the real large production data, and thus don't see that a query would scale badly, and would not see any traversal warnings, as these only happen with a large number of results.
> *Proposal:* Oak's query engine already calculates a cost estimate to make a decision which index to use, or even if there is any at all. This cost estimate could be used to find out if a query is not supported by an index or with one that is not suitable enough (e.g. ordering by property that is not indexed)
> If a query is above a certain cost value, a big warning could be put out or even the query could be made to fail (maybe a per query option, that you might want to have to "fail" by default to ensure people are not overlooking the problem). The cost limit should be configurable, as it might depend on the hardware power.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)