[
https://issues.apache.org/jira/browse/OAK-4887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15591350#comment-15591350
]
Thomas Mueller edited comment on OAK-4887 at 10/20/16 9:39 AM:
---------------------------------------------------------------
[~alexander.klimetschek] could you provide an example (query, index
definitions) so that I can understand what is the most pressing issue? Would it
help in your case if we add "query option" mechanism as follows, so that the
query engine knows what is more important?
Example (about matchin 2000 rows)
{noformat}
//element(*, 'ec:Product')[@color = 'red' and @size = 'L'] order by @popularity
desc
-> expectes the whole result to be read
-> will favor an index on color, size
//element(*, 'ec:Product')[@color = 'red' and @size = 'L'] order by @popularity
desc option(fast 10)
-> will favor an index on ec:Product + popularity,
so that the first 10 rows can be returned quickly
{noformat}
was (Author: tmueller):
[~alexander.klimetschek] could you provide an example (query, index
definitions) so that I can understand what is the most pressing issue? Would it
help in your case if we add "query option" mechanism as follows, so that the
query engine knows what is more important?
Example (about 10000 rows with
{noformat}
//element(*, 'ec:Product')[@color = 'red' and @size = 'L'] order by @popularity
desc
-> expectes the whole result to be read
-> will favor an index on color, size
//element(*, 'ec:Product')[@color = 'red' and @size = 'L'] order by @popularity
desc option(fast 10)
-> will favor an index on ec:Product + popularity,
so that the first 10 rows can be returned quickly
{noformat}
> Query cost estimation: ordering by an unindexed property not reflected
> ----------------------------------------------------------------------
>
> Key: OAK-4887
> URL: https://issues.apache.org/jira/browse/OAK-4887
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: query
> Affects Versions: 1.4.2
> Reporter: Alexander Klimetschek
> Assignee: Thomas Mueller
> Fix For: 1.6
>
>
> A query that orders by an unindexed property seems to have no effect on the
> cost estimation, compared to the same query without the order by, although it
> has a big impact on the execution performance for larger results/indexes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)