[ https://issues.apache.org/jira/browse/OAK-4887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16256706#comment-16256706 ]
Vikas Saurabh commented on OAK-4887: ------------------------------------ [~tmueller], bq. This is because the Lucene index returns a lower cost if "order by" of that property is supported by the index (I think each indexed property reduces the cost of the index). Maybe, we can remove the sort hack from lucene index planner now - but, I think its still better that a index-based-sort gets preferred over in-mem sort done by query engine because even getting the first row for in-mem-sort case requires loading the whole result set. (I mean maybe, index-based-sort should still get preferred but the logic moves into query engine and the hack is removed from lucene index planner). > 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.8, 1.7.12 > > > 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.4.14#64029)