You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Vladsz83 (via GitHub)" <gi...@apache.org> on 2023/10/08 15:47:08 UTC
[PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Vladsz83 opened a new pull request, #10983:
URL: https://github.com/apache/ignite/pull/10983
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358115951
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ V1 FROM TBL1 WHERE V1=? AND V2=?
+UNION ALL
+SELECT V1 FROM TBL1 WHERE V3>?
+----
+
+But *there are exceptions*: hints of engine or optimizer level like link:#hint_disable_rule[_DISABLE_RULE_] or
+link:#hint_query_engine[_QUERY_ENGINE_]. Such hints should be defined at the beginning of query and relates to the
+whole query.
+
+=== Hints errors
+The optimizer tries to apply every hint and hint parameter if able. But skips hint or hint parameter if:
Review Comment:
The optimizer tries to apply every hint and its parameters, if possible. But it skips the hint or hint parameter if:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358009336
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
Review Comment:
1) Опционально: возможно, лучше заменить to **build** the plan на to **create** the plan? Это более устойчивое выражение.
2) Опционально: можно заменить **But** на **However** (так корректнее с точки зрения официальных документов).
3) Заменить **it is** на **this is**
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
Review Comment:
1) Опционально: возможно, лучше заменить to **build** the plan на to **create** the plan? Это более устойчивое выражение.
2) Опционально: можно заменить **But** на **However** (так корректнее с точки зрения официальных документов).
3) Заменить **it is** на **this is**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358015683
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
Review Comment:
'create' occurs soon with 'create an optimizer' . I think 'to build' is betetr in this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358046741
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
Review Comment:
Note that only the first query has a hint in such a case as:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "alex-plekhanov (via GitHub)" <gi...@apache.org>.
alex-plekhanov commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1356733426
##########
docs/_docs/sql-reference/hints.adoc:
##########
@@ -0,0 +1,17 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+= Optimizer hints
Review Comment:
Is there any reference to this file? Why do we need it?
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,152 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped by. Especially in case of a long, complex query or if
+a hint is defined deep inside a query.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Currently, only simple, plain hint parameters are supported (no key-value). Hint parameters, if required, are placed
Review Comment:
Let's remove `Currently, only simple, plain hint parameters are supported (no key-value).` User doesn't know about key-value format, so it can be a liitle bit confusing.
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,152 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped by. Especially in case of a long, complex query or if
Review Comment:
Let's remove `Especially in case of a long, complex query or if a hint is defined deep inside a query.`, it's hard to describe all the cases when hints will be skipped, so let's just say `in some cases`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358037904
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
Review Comment:
'To use several hints, separate them by comma(spaces are optional)'? Usually, 'a' is not placed before 'comma' or 'commas' in the cases like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358117661
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ V1 FROM TBL1 WHERE V1=? AND V2=?
+UNION ALL
+SELECT V1 FROM TBL1 WHERE V3>?
+----
+
+But *there are exceptions*: hints of engine or optimizer level like link:#hint_disable_rule[_DISABLE_RULE_] or
+link:#hint_query_engine[_QUERY_ENGINE_]. Such hints should be defined at the beginning of query and relates to the
+whole query.
+
+=== Hints errors
+The optimizer tries to apply every hint and hint parameter if able. But skips hint or hint parameter if:
+
+* There is no such supported hint.
+* Required hint parameters are not passed.
+* Hint parameters passed but hint doesn't support any parameter.
Review Comment:
The hint parameters have been passed, but the hint does not support any parameters.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed pull request #10983: IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX
URL: https://github.com/apache/ignite/pull/10983
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358037904
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
Review Comment:
'To use several hints, separate them by comma(spaces are optional)'? Usually, 'a' is not placed before 'comma' or 'commas' in the cases like this. There are
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358009336
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
Review Comment:
1) optional: to **build** the plan >> to **create** the plan
2) Оptional: **But** >> **However**
3) **it is** >> **this is**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358120107
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ V1 FROM TBL1 WHERE V1=? AND V2=?
+UNION ALL
+SELECT V1 FROM TBL1 WHERE V3>?
+----
+
+But *there are exceptions*: hints of engine or optimizer level like link:#hint_disable_rule[_DISABLE_RULE_] or
+link:#hint_query_engine[_QUERY_ENGINE_]. Such hints should be defined at the beginning of query and relates to the
+whole query.
+
+=== Hints errors
+The optimizer tries to apply every hint and hint parameter if able. But skips hint or hint parameter if:
+
+* There is no such supported hint.
+* Required hint parameters are not passed.
+* Hint parameters passed but hint doesn't support any parameter.
+* Hint parameter is mistaken or relates to an unexisting entity like unexisting index or table.
Review Comment:
The hint parameter is incorrect or refers to a nonexistent object, such as a nonexistent index or table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358025146
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
Review Comment:
— Для единообразия лучше везде писать с заглавной, SQL
— Вариант для замены первого предложения: SQL hints are defined **by a** special comment (или **using a** special comment)/*+ HINT */ reffered as **a** hint block.
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
Review Comment:
— Для единообразия лучше везде писать с заглавной, SQL
— Вариант для замены первого предложения: SQL hints are defined **by a** special comment (или **using a** special comment)/*+ HINT */ reffered as **a** hint block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1357991163
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -123,19 +123,6 @@ QUERY_ENGINE=CALCITE
----
--
-=== QUERY_ENGINE Hint
-
Review Comment:
Кажется, здесь можно убрать the перед QUERY_ENGINE — посмотрела в доках Microsoft, там перед названиями команд не ставят артикль.
Здесь же — возможно, стоит заменить select на choose? Логика такая: в случае select мы передаем смысл о тщательном многоэтапном отборе, который отнимает много времени. Здесь же из контекста кажется, что речь скорее про быстрый выбор пользователем нужного движка.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358025146
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
Review Comment:
— sql << SQL
— SQL hints are defined **by a** special comment (or **using a** special comment)/*+ HINT */ reffered as **a** hint block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358028749
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
Review Comment:
— **The** hint block
The hint block is placed right after a relation operator, usually after SELECT.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358015683
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
Review Comment:
'create' occurs soon with 'create an optimizer' . I think 'to build' is better in this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358121135
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ V1 FROM TBL1 WHERE V1=? AND V2=?
+UNION ALL
+SELECT V1 FROM TBL1 WHERE V3>?
+----
+
+But *there are exceptions*: hints of engine or optimizer level like link:#hint_disable_rule[_DISABLE_RULE_] or
+link:#hint_query_engine[_QUERY_ENGINE_]. Such hints should be defined at the beginning of query and relates to the
+whole query.
+
+=== Hints errors
+The optimizer tries to apply every hint and hint parameter if able. But skips hint or hint parameter if:
+
+* There is no such supported hint.
+* Required hint parameters are not passed.
+* Hint parameters passed but hint doesn't support any parameter.
+* Hint parameter is mistaken or relates to an unexisting entity like unexisting index or table.
+* Current hints or current parameters are incompatible with the previous ones like forcing and disabling of the same index.
Review Comment:
The current hints or current parameters are incompatible with the previous ones, such as forcing the use and disabling of the same index.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358124331
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ V1 FROM TBL1 WHERE V1=? AND V2=?
+UNION ALL
+SELECT V1 FROM TBL1 WHERE V3>?
+----
+
+But *there are exceptions*: hints of engine or optimizer level like link:#hint_disable_rule[_DISABLE_RULE_] or
+link:#hint_query_engine[_QUERY_ENGINE_]. Such hints should be defined at the beginning of query and relates to the
+whole query.
+
+=== Hints errors
+The optimizer tries to apply every hint and hint parameter if able. But skips hint or hint parameter if:
+
+* There is no such supported hint.
+* Required hint parameters are not passed.
+* Hint parameters passed but hint doesn't support any parameter.
+* Hint parameter is mistaken or relates to an unexisting entity like unexisting index or table.
+* Current hints or current parameters are incompatible with the previous ones like forcing and disabling of the same index.
+
+=== Supportted hints
+
+==== FORCE_INDEX / NO_INDEX
+Forces or disables index scan.
+
+===== Parameters:
+* Empty. To force an index scan for every undelying table. Optimizer will choose any available index. Or to disable all indexes.
+* Single index name to use or skip exactly this index.
+* Several index names. Might relate to different tables. Optimizer will choose ones to scan or skip all of them.
Review Comment:
This can relate to different tables. The optimizer will choose them for scanning or skip them all.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358039586
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
Review Comment:
The hint parameter can be quoted. Quoted parameter is case-sensitive. The quoted and unquoted parameters cannot be defined for the same hint.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358017765
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
Review Comment:
Здесь лучше убрать The перед SQL hints (т.к. упоминаем впервые, без конкретики)
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
Review Comment:
Здесь лучше убрать The перед SQL hints (т.к. упоминаем впервые, без конкретики)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358031794
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
Review Comment:
Passive to active:
To do this, separate the hints with a comma (spaces are optional).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358019831
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
Review Comment:
SQL hints are optional and may be skipped in some cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358002218
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -123,19 +123,6 @@ QUERY_ENGINE=CALCITE
----
--
-=== QUERY_ENGINE Hint
-
Review Comment:
This section is removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358036778
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
Review Comment:
Hint parameters, if required, are placed in brackets after the hint name and separated by commas.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358044306
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
Review Comment:
Hints are defined for the relation operator, usually for SELECT. Most of the hints are "visible" to their relation operators, for the following operators, queries and subqueries. The hints defined in the subquery are "visible" only for this subquery and its subqueries. The hint is not "visible" to the previous relation operator if it is defined after it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358050935
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ V1 FROM TBL1 WHERE V1=? AND V2=?
+UNION ALL
+SELECT V1 FROM TBL1 WHERE V3>?
+----
+
+But *there are exceptions*: hints of engine or optimizer level like link:#hint_disable_rule[_DISABLE_RULE_] or
Review Comment:
But there are exceptions: hints of engine or optimizer level, such as DISABLE_RULE or QUERY_ENGINE. Such hints should be defined at the beginning of the query and are related to the whole query.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358125618
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
+(spaces are optional).
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX, EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3 WHERE V3=?
+----
+
+==== Hint parameters
+Hint parameters, if required, are placed within brackets after the hint name and are separated with commas.
+
+Hint parameter can be quoted. Quoted parameter is case sensitive. Quoted and unquoted parameters *cannot be*
+defined for the same hint.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX(TBL1_IDX2,TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ FORCE_INDEX('TBL2_idx1') */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+=== Hint scope
+Hints are difined for a relation operator. Usually for _SELECT_. Most of the hints are 'visible' for their relation
+operators, for following operators, queries and sub-queries. Hint defined in a sub-query are 'visible' only for
+this sub-subery and its sub-queries. Hint is not 'visible' for a preceding relation operator if defined after it.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX(TBL1_IDX2), FORCE_INDEX(TBL2_IDX2) */ T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+
+SELECT T1.V1 FROM TBL1 T1 WHERE T1.V2 IN (SELECT /*+ FORCE_INDEX(TBL2_IDX2) */ T2.V2 FROM TBL2 T2 WHERE T2.V1=? AND T2.V2=?);
+----
+
+Note, only the first query has a hint in a case like:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ V1 FROM TBL1 WHERE V1=? AND V2=?
+UNION ALL
+SELECT V1 FROM TBL1 WHERE V3>?
+----
+
+But *there are exceptions*: hints of engine or optimizer level like link:#hint_disable_rule[_DISABLE_RULE_] or
+link:#hint_query_engine[_QUERY_ENGINE_]. Such hints should be defined at the beginning of query and relates to the
+whole query.
+
+=== Hints errors
+The optimizer tries to apply every hint and hint parameter if able. But skips hint or hint parameter if:
+
+* There is no such supported hint.
+* Required hint parameters are not passed.
+* Hint parameters passed but hint doesn't support any parameter.
+* Hint parameter is mistaken or relates to an unexisting entity like unexisting index or table.
+* Current hints or current parameters are incompatible with the previous ones like forcing and disabling of the same index.
+
+=== Supportted hints
+
+==== FORCE_INDEX / NO_INDEX
+Forces or disables index scan.
+
+===== Parameters:
+* Empty. To force an index scan for every undelying table. Optimizer will choose any available index. Or to disable all indexes.
+* Single index name to use or skip exactly this index.
+* Several index names. Might relate to different tables. Optimizer will choose ones to scan or skip all of them.
+
+===== Example:
+[source, SQL]
+----
+SELECT /*+ FORCE_INDEX */ T1.* FROM TBL1 T1 WHERE T1.V1 = T2.V1 AND T1.V2 > ?;
+
+SELECT /*+ FORCE_INDEX(TBL1_IDX2, TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 T1 WHERE T1.V1 = T2.V1 AND T1.V2 > ?;
+
+SELECT /*+ NO_INDEX(TBL1_IDX2, TBL2_IDX1) */ T1.V1, T2.V1 FROM TBL1 T1, TBL2 T2 WHERE T1.V1 = T2.V1 AND T1.V2 > ? AND T2.V2 > ?;
+----
+
+==== ORDERED_JOINS
+Forces join order as appears in a query. Fastens building of joins plan.
+
+===== Example:
+[source, SQL]
+----
+SELECT /*+ ORDERED_JOINS */ T1.V1, T2.V1, T2.V2, T3.V1, T3.V2, T3.V3 FROM TBL1 T1 JOIN TBL2 T2 ON T1.V3=T2.V1 JOIN TBL3 T3 ON T2.V3=T3.V1 AND T2.V2=T3.V2
+
+SELECT t1.v1, t3.v2 FROM TBL1 t1 JOIN TBL3 t3 on t1.v3=t3.v3 WHERE t1.v2 in (SELECT /*+ ORDERED_JOINS */ t2.v2 FROM TBL2 t2 JOIN TBL3 t3 ON t2.v1=t3.v1)
+----
+
+==== EXPAND_DISTINCT_AGG
+If the optimizer wraps aggregation operations with a join, forces expanding of only distinct aggregates to the join.
+Removes duplicates before the joining and speeds up it.
+
+===== Example:
+[source, SQL]
+----
+SELECT /*+ EXPAND_DISTINCT_AGG */ SUM(DISTINCT V1), AVG(DISTINCT V2) FROM TBL1 GROUP BY V3
+----
+
+==== QUERY_ENGINE [[hint_query_engine]]
+Selects a particular engine to run individual queries. This is an engine level hint.
+
+===== Parameters:
+Single parameter required: the engine name.
+
+===== Example:
+[source, SQL]
+----
+SELECT /*+ QUERY_ENGINE('calcite') */ V1 FROM TBL1
+----
+
+==== DISABLE_RULE [[hint_disable_rule]]
+Disables certain optimizer rules. This is an optimizer level hint.
+
+===== Parameters:
+* One or several optimizer rules to skip.
Review Comment:
One or more optimizer rules for skipping.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1357991163
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -123,19 +123,6 @@ QUERY_ENGINE=CALCITE
----
--
-=== QUERY_ENGINE Hint
-
Review Comment:
Кажется, здесь можно убрать the перед QUERY_ENGINE — посмотрела в доках Microsoft, там перед названиями команд не ставят артикль.
Здесь же — возможно, стоит заменить select на choose? Логика такая: в случае select мы передаем смысл о тщательном многоэтапном отборе, который отнимает много времени. Здесь же из контекста кажется, что речь скорее про быстрый выбор пользователем нужного движка.
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -123,19 +123,6 @@ QUERY_ENGINE=CALCITE
----
--
-=== QUERY_ENGINE Hint
-
Review Comment:
Кажется, здесь можно убрать the перед QUERY_ENGINE — посмотрела в доках Microsoft, там перед названиями команд не ставят артикль.
Здесь же — возможно, стоит заменить select на choose? Логика такая: в случае select мы передаем смысл о тщательном многоэтапном отборе, который отнимает много времени. Здесь же из контекста кажется, что речь скорее про быстрый выбор пользователем нужного движка.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358002218
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -123,19 +123,6 @@ QUERY_ENGINE=CALCITE
----
--
-=== QUERY_ENGINE Hint
-
Review Comment:
This section removed. Nothing to fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358014876
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
Review Comment:
Опционально: лучше заменить You may have better knowledge на You can better know about data design... (как-то ближе к английскому)
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
Review Comment:
Опционально: лучше заменить You may have better knowledge на You can better know about data design... (как-то ближе к английскому)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358028749
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
Review Comment:
— **The** hint block
— Наверное, лучше объединить эти два предложения в одно, а то разрывается связь:
The hint block is placed right after a relation operator, usually after SELECT.
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
Review Comment:
— **The** hint block
— Наверное, лучше объединить эти два предложения в одно, а то разрывается связь:
The hint block is placed right after a relation operator, usually after SELECT.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358019831
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
Review Comment:
Для краткости можно заменить на SQL hints are optional and may be skipped in some cases.
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
Review Comment:
Для краткости можно заменить на SQL hints are optional and may be skipped in some cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358031794
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
Review Comment:
Лучше заменить пассивный залог на активный:
To do this, separate the hints with a comma (spaces are optional).
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
+execution plan faster.
+
+[NOTE]
+====
+SQL hints are not mandatory to apply and might be skipped in some cases.
+====
+
+=== Hints format
+Sql hints are defined with the special comment +++/*+ HINT */+++ reffered as _hint block_. Spaces before and after the
+hint name are required. Hint block is placed right after a relation operator. Usually, after _SELECT_. Several hint
+blocks for one relation operator *are not allowed*.
+
+Example:
+[source, SQL]
+----
+SELECT /*+ NO_INDEX */ T1.* FROM TBL1 where T1.V1=? and T1.V2=?
+----
+
+It is allowed to define several hints for the same relation operator. For that, hints are separated with comma
Review Comment:
Лучше заменить пассивный залог на активный:
To do this, separate the hints with a comma (spaces are optional).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-20587 : SQL hints documentation. INDEX, NO_INDEX [ignite]
Posted by "annagobova (via GitHub)" <gi...@apache.org>.
annagobova commented on code in PR #10983:
URL: https://github.com/apache/ignite/pull/10983#discussion_r1358017765
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -241,3 +228,150 @@ Below are the data types supported by the Calcite-based SQL engine:
|`java.lang.Object`
|===
+
+== Optimizer hints [[hints]]
+
+The query optimizer does its best to build the fastest excution plan. But it is a far way to create an optimizer which
+is the most effective for each case. You may have better knowledge of your data design, application design or data
+distribution in the cluster. The SQL hints can help the optimizer to make optimizations more rationally or build
Review Comment:
SQL hints without The
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org