[ 
https://issues.apache.org/jira/browse/IGNITE-21416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrey Novikov updated IGNITE-21416:
------------------------------------
    Description: 
Globally it works the same way as in 
[https://ignite.apache.org/docs/latest/SQL/sql-calcite#force_index-no_index], 
but has some difference when FORCE_INDEX and NO_INDEX used together in the same 
query.

When both hints reference to the same index - it is invalid case. SQL is 
declarative language and we shouldn't expect {{hints}} collection is ordered:
{code:java}
SELECT /*+ FORCE_INDEX(IDX_ID), NO_INDEX */ * FROM TBL1 WHERE id = ? AND val = ?
OR
SELECT /*+ NO_INDEX(IDX_VAL), FORCE_INDEX(IDX_VAL) */ * FROM TBL1 WHERE val = 
?{code}
 

*What to do*

We need to fix example section and rewrite "Hint Scope" section.

  was:
Globally it works the same way as in 
[https://ignite.apache.org/docs/latest/SQL/sql-calcite#force_index-no_index], 
but has some difference when FORCE_INDEX and NO_INDEX used together in the same 
query.

When both hints reference to the same index - it is invalid case. SQL is 
declarative language and we shouldn't expect {{hints}} collection is 
ordered:{{{{}}{}}}
{code:java}
SELECT /*+ FORCE_INDEX(IDX_ID), NO_INDEX */ * FROM TBL1 WHERE id = ? AND val = ?
OR
SELECT /*+ NO_INDEX(IDX_VAL), FORCE_INDEX(IDX_VAL) */ * FROM TBL1 WHERE val = 
?{code}
 

*What to do*

We need to fix example section and rewrite "Hint Scope" section.


> Add documentation for FORCE_INDEX/NO_INDEX hints
> ------------------------------------------------
>
>                 Key: IGNITE-21416
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21416
>             Project: Ignite
>          Issue Type: Improvement
>          Components: documentation, sql
>            Reporter: Andrey Novikov
>            Priority: Minor
>              Labels: ignite-3
>
> Globally it works the same way as in 
> [https://ignite.apache.org/docs/latest/SQL/sql-calcite#force_index-no_index], 
> but has some difference when FORCE_INDEX and NO_INDEX used together in the 
> same query.
> When both hints reference to the same index - it is invalid case. SQL is 
> declarative language and we shouldn't expect {{hints}} collection is ordered:
> {code:java}
> SELECT /*+ FORCE_INDEX(IDX_ID), NO_INDEX */ * FROM TBL1 WHERE id = ? AND val 
> = ?
> OR
> SELECT /*+ NO_INDEX(IDX_VAL), FORCE_INDEX(IDX_VAL) */ * FROM TBL1 WHERE val = 
> ?{code}
>  
> *What to do*
> We need to fix example section and rewrite "Hint Scope" section.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to