[
https://issues.apache.org/jira/browse/PHOENIX-4964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16645561#comment-16645561
]
William Shen commented on PHOENIX-4964:
---------------------------------------
Is this observed for Global, or local index, or both?
In [https://phoenix.apache.org/secondary_indexing.html],
Under "Global Indexes":
bq. By default, unless hinted, an index will not be used for a query that
references a column that isn’t part of the index.
Under "Local Indexes":
bq. Local indexes can be used even when the query isn’t fully covered (i.e.
Phoenix automatically retrieve the columns not in the index through point gets
against the data table).
I guess when we pick up this ticket, we should be sure to update the
documentation accordingly.
> ORDER BY does not use an index if the query is not fully covered
> ----------------------------------------------------------------
>
> Key: PHOENIX-4964
> URL: https://issues.apache.org/jira/browse/PHOENIX-4964
> Project: Phoenix
> Issue Type: Improvement
> Reporter: Lars Hofhansl
> Priority: Minor
>
> I just noticed that a query like
> {{SELECT <column1> FROM <table> ORDER BY <column2> LIMIT <n>}}
> Does not use an index on <column2> if it does not also include <column1>.
> That seems too limited.
> I can see the code in QueryOptimizer.addPlan that rewrites the plan only when
> there's a WHERE clause, and then only for the WHERE clause.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)