You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/05/01 22:38:00 UTC
[jira] [Commented] (ASTERIXDB-3162) Use index hint not honored for AND predicates when CBO is on
[ https://issues.apache.org/jira/browse/ASTERIXDB-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17718363#comment-17718363 ]
ASF subversion and git services commented on ASTERIXDB-3162:
------------------------------------------------------------
Commit e42e1b99e7f9a5a7437234be89438f37a18a06d2 in asterixdb's branch refs/heads/master from Vijay Sarathy
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=e42e1b99e7 ]
[ASTERIXDB-3162][COMP] Use index hint not honored for AND predicates when CBO is on.
Change-Id: I9a6c16d3f1537153f8b3353a1f858d7e3df8d209
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17487
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>
> Use index hint not honored for AND predicates when CBO is on
> ------------------------------------------------------------
>
> Key: ASTERIXDB-3162
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-3162
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: COMP - Compiler
> Affects Versions: 0.9.6
> Reporter: Vijay Sarathy
> Assignee: Vijay Sarathy
> Priority: Major
>
> This is a fragment of CH2 query 6. This issue is reproducible with similar queries on non-CH2 tables also and happens with both array and non-array indexes.
> {code:java}
> SELECT count(*) as revenue
> FROM orders o, o.o_orderline ol
> WHERE ol.ol_delivery_d /*+ use-index (orderline_delivery_d) */ >= '2016-01-01 00:00:00.000000'
> AND ol.ol_delivery_d /*+ use-index (orderline_delivery_d) */ < '2017-01-01 00:00:00.000000';
> {code}
> The hint is honored when there is only a single predicate with no ANDs. The problem happens because the hint is not placed on the condition (as it is done for single predicates), but the condition has an "arguments" field which has the annotation. To fix this, we need to check the "arguments" field of the condition for the annotation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)