diff --git a/product/en/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/en/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index 586d50cd8e8c5b92d3db1f8d613df0f36d39649c..7badd9f782c01ec426345f2b38f685cf0acb735c 100644 --- a/product/en/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/en/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -191,7 +191,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/en/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index ecac86d19386d4aef84393e5dddbce34c74cd5e0..7d615fb75e919d900c138fa0fcd162669a523a78 100644 --- a/product/en/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/en/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -195,7 +195,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md b/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md index 6d27e335842b8fb161cd372e0f06a04348c59a39..185761464afab952d5416d791671ff6a84b7e767 100644 --- a/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md +++ b/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md @@ -144,7 +144,7 @@ This parameter is a SIGHUP parameter. Set it based on instructions provided in T - **on** indicates that the host name is simultaneously recorded. - **off** indicates that the host name is not simultaneously recorded. -**Default value**: **on** +**Default value**: **off** ## log_line_prefix diff --git a/product/en/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md b/product/en/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md index ab366c354e1e4def440e96bbb6d2fd8687f2c18c..0a634591b35fa15063e6f4a38a7ded8405784ce6 100644 --- a/product/en/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md +++ b/product/en/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 Valid literal values for the "true" state include: -**TRUE**, **'t'**, **'true'**, **'y'**, **'yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 2^63 - 1 or from -1 to -2^63. +**TRUE**, **'t'**, **'True'**, **'true'**, **'y'**, **'yes'**, **'Yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 263-1 or from -1 to -263. Valid literal values for the "false" state include: -**FALSE**, **'f'**, **'false'**, **'n'**, **'no'**, **'0'**, **0**, **'FALSE'**, and **false**. +**FALSE**, **'f'**, **'false'**, **'False'**, **'n'**, **'no'**, **'No'**, **'0'**, **0**, **'FALSE'**, and **false**. **TRUE** and **FALSE** are standard expressions, compatible with SQL statements. diff --git a/product/en/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/en/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index 586d50cd8e8c5b92d3db1f8d613df0f36d39649c..7badd9f782c01ec426345f2b38f685cf0acb735c 100644 --- a/product/en/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/en/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -191,7 +191,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/en/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index ecac86d19386d4aef84393e5dddbce34c74cd5e0..7d615fb75e919d900c138fa0fcd162669a523a78 100644 --- a/product/en/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/en/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -195,7 +195,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md b/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md index 74bb1ff0cc4e3ddc953757c0984a8746ca73e702..7eab7d6c25e6e3e2c195094e2277e5f5476c2719 100644 --- a/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md +++ b/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md @@ -144,7 +144,7 @@ This parameter is a SIGHUP parameter. Set it based on instructions provided in T - **on** indicates that the host name is simultaneously recorded. - **off** indicates that the host name is not simultaneously recorded. -**Default value**: **on** +**Default value**: **off** ## log_line_prefix diff --git a/product/en/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md b/product/en/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md index ab366c354e1e4def440e96bbb6d2fd8687f2c18c..0a634591b35fa15063e6f4a38a7ded8405784ce6 100644 --- a/product/en/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md +++ b/product/en/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 Valid literal values for the "true" state include: -**TRUE**, **'t'**, **'true'**, **'y'**, **'yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 2^63 - 1 or from -1 to -2^63. +**TRUE**, **'t'**, **'True'**, **'true'**, **'y'**, **'yes'**, **'Yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 263-1 or from -1 to -263. Valid literal values for the "false" state include: -**FALSE**, **'f'**, **'false'**, **'n'**, **'no'**, **'0'**, **0**, **'FALSE'**, and **false**. +**FALSE**, **'f'**, **'false'**, **'False'**, **'n'**, **'no'**, **'No'**, **'0'**, **0**, **'FALSE'**, and **false**. **TRUE** and **FALSE** are standard expressions, compatible with SQL statements. diff --git a/product/en/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/en/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index 48a07df114c5a86678733a83a94bf3159e0f21d9..cac7f97afe733cd4ccc8898d699318306af0e5f0 100644 --- a/product/en/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/en/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -191,7 +191,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/en/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index ecac86d19386d4aef84393e5dddbce34c74cd5e0..7d615fb75e919d900c138fa0fcd162669a523a78 100644 --- a/product/en/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/en/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -195,7 +195,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md b/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md index 66a90888acbb4fd5303610af67fed6bb1053eaef..c98dee1dcd2126ae956b36f672f96ee420896b7f 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md @@ -144,7 +144,7 @@ This parameter is a SIGHUP parameter. Set it based on instructions provided in T - **on** indicates that the host name is simultaneously recorded. - **off** indicates that the host name is not simultaneously recorded. -**Default value**: **on** +**Default value**: **off** ## log_line_prefix diff --git a/product/en/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md b/product/en/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md index 67d2a12b979bf094bc1a7a8d00207251f30f700b..ae89f4f639beefdec16724cffbbcffad5c98fb08 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 Valid literal values for the "true" state include: -**TRUE**, **'t'**, **'true'**, **'y'**, **'yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 2^63 - 1 or from -1 to -2^63. +**TRUE**, **'t'**, **'True'**, **'true'**, **'y'**, **'yes'**, **'Yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 263-1 or from -1 to -263. Valid literal values for the "false" state include: -**FALSE**, **'f'**, **'false'**, **'n'**, **'no'**, **'0'**, **0**, **'FALSE'**, and **false**. +**FALSE**, **'f'**, **'false'**, **'False'**, **'n'**, **'no'**, **'No'**, **'0'**, **0**, **'FALSE'**, and **false**. **TRUE** and **FALSE** are standard expressions, compatible with SQL statements. diff --git a/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md b/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md index ab1421ee35b60018a66e9e6b20d83270c4994c47..f6755f962e051c67c8eb8db89a1c5f052dad1719 100644 --- a/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md +++ b/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md @@ -152,7 +152,7 @@ This parameter is a USERSET parameter. Set it based on instructions provided in - **intargetlist**: Uses the In Target List query rewriting rules (subquery optimization in the target column). - **predpushnormal**: Use the Predicate Push query rewriting rule (push the predicate condition to the subquery). - **predpushforce**: Uses the Predicate Push query rewriting rules. Push down predicate conditions to subqueries and use indexes as much as possible for acceleration. -- **predpush**: Selects the optimal plan based on the cost in **predpushnormal** and **predpushforce**. +- **predpush**: Selects the optimal plan based on the cost in **predpushnormal** and **predpushforce**. **Note**: The rewriting rule for the **predpush** can in rare scenarios result in failure to generate a legal plan, and full testing is recommended before enabling the parameter. - **reduce_orderby**:Uses the reduce orderby query rewriting rule (remove unnecessary sorting in subquery). **Default value**: **magicset, reduce_orderby** diff --git a/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md b/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md index 5d12b38521e1b9c50feee7b9c84a7ca957036fb1..a089fca7cbfb767a2efff852c3da8bf4ac467366 100644 --- a/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md +++ b/product/en/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md @@ -36,7 +36,8 @@ This parameter is an INTERNAL parameter. Set it based on instructions provided i **Value range**: enumerated values -**top**: Only top-level SQL statements are recorded. +- **top**: Only top-level SQL statements are recorded. +- **all**: All SQL statements are recorded (including SQL statements within stored procedures and functions). **Default value**: **top** diff --git a/product/en/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/en/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index 48a07df114c5a86678733a83a94bf3159e0f21d9..cac7f97afe733cd4ccc8898d699318306af0e5f0 100644 --- a/product/en/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/en/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -191,7 +191,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/en/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index ecac86d19386d4aef84393e5dddbce34c74cd5e0..7d615fb75e919d900c138fa0fcd162669a523a78 100644 --- a/product/en/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/en/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ On the host, upload the client tool package and configure environment variables Assume you are to allow the client whose IP address is **172.16.0.245** to access the current host. ```sql - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **NOTICE:** @@ -195,7 +195,7 @@ On the host, upload the client tool package and configure environment variables - **jack** indicates the user that accesses the database. - - **172.16.0.245/24** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **24** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.0. + - **172.16.0.245/32** indicates that only the client whose IP address is **172.16.0.245** can connect to the host. The specified IP address must be different from those used in MogDB. **32** indicates that there are 24 bits whose value is 1 in the subnet mask. That is, the subnet mask is 255.255.255.255. - **sha256** indicates that the password of user **jack** is encrypted using the SHA-256 algorithm. diff --git a/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md b/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md index 66a90888acbb4fd5303610af67fed6bb1053eaef..c98dee1dcd2126ae956b36f672f96ee420896b7f 100644 --- a/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md +++ b/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md @@ -144,7 +144,7 @@ This parameter is a SIGHUP parameter. Set it based on instructions provided in T - **on** indicates that the host name is simultaneously recorded. - **off** indicates that the host name is not simultaneously recorded. -**Default value**: **on** +**Default value**: **off** ## log_line_prefix diff --git a/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md b/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md index 5d12b38521e1b9c50feee7b9c84a7ca957036fb1..a089fca7cbfb767a2efff852c3da8bf4ac467366 100644 --- a/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md +++ b/product/en/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md @@ -36,7 +36,8 @@ This parameter is an INTERNAL parameter. Set it based on instructions provided i **Value range**: enumerated values -**top**: Only top-level SQL statements are recorded. +- **top**: Only top-level SQL statements are recorded. +- **all**: All SQL statements are recorded (including SQL statements within stored procedures and functions). **Default value**: **top** diff --git a/product/en/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md b/product/en/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md index 67d2a12b979bf094bc1a7a8d00207251f30f700b..ae89f4f639beefdec16724cffbbcffad5c98fb08 100644 --- a/product/en/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md +++ b/product/en/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 Valid literal values for the "true" state include: -**TRUE**, **'t'**, **'true'**, **'y'**, **'yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 2^63 - 1 or from -1 to -2^63. +**TRUE**, **'t'**, **'True'**, **'true'**, **'y'**, **'yes'**, **'Yes'**, **'1'**, **'TRUE'**, **true**, and an integer ranging from 1 to 263-1 or from -1 to -263. Valid literal values for the "false" state include: -**FALSE**, **'f'**, **'false'**, **'n'**, **'no'**, **'0'**, **0**, **'FALSE'**, and **false**. +**FALSE**, **'f'**, **'false'**, **'False'**, **'n'**, **'no'**, **'No'**, **'0'**, **0**, **'FALSE'**, and **false**. **TRUE** and **FALSE** are standard expressions, compatible with SQL statements. diff --git a/product/zh/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/zh/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index aa48c19a5be7527a610db2dacf505ee3bfb38de6..cab2c2f25f6075013484121ef55828de11b74fce 100644 --- a/product/zh/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/zh/docs-mogdb/v3.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ date: 2021-12-2 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意:** @@ -191,7 +191,7 @@ date: 2021-12-2 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/9-hint-based-tuning.md b/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/9-hint-based-tuning.md index 78652c1bc344c568f7e5f3acb60d29a94b23f7dd..974709a3c982801efcf4ee6393c2c69d6f033a9c 100644 --- a/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/9-hint-based-tuning.md +++ b/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/9-hint-based-tuning.md @@ -13,7 +13,7 @@ date: 2021-03-04 Plan Hint为用户提供了直接影响执行计划生成的手段,用户可以通过指定join顺序,join、scan方法,指定结果行数,等多个手段来进行执行计划的调优,以提升查询的性能。 -
+MogDB还提供了SQL PATCH功能,在不修改业务语句的前提下通过创建SQL PATCH的方式使得Hint生效。 ### 功能描述 @@ -37,8 +37,6 @@ select /*+ */ * from t1, (select /*+ */ f > 如果在视图定义(CREATE VIEW)时指定hint,则在该视图每次被应用时会使用该hint。 > 当使用random plan功能(参数plan_mode_seed不为0)时,查询指定的plan hint不会被使用。 -
- ### 支持范围 当前版本Plan Hint支持的范围如下,后续版本会进行增强。 @@ -49,14 +47,10 @@ select /*+ */ * from t1, (select /*+ */ f - 指定Scan方式的Hint,仅支持常用的tablescan,indexscan和indexonlyscan的hint。 - 指定子链接块名的Hint -
- ### 注意事项 不支持Agg、Sort、Setop和Subplan的hint。 -
- ### 示例 本章节使用同一个语句进行示例,便于Plan Hint支持的各方法作对比,示例语句及不带hint的原计划如下所示: @@ -281,14 +275,10 @@ group by i_product_name ## Join顺序的Hint -
- ### 功能描述 指明join的顺序,包括内外表顺序。 -
- ### 语法格式 - 仅指定join顺序,不指定内外表顺序。 @@ -303,8 +293,6 @@ group by i_product_name leading((join_table_list)) ``` -
- ### 参数说明 join_table_list为表示表join顺序的hint字符串,可以包含当前层的任意个表(别名),或对于子查询提升的场景,也可以包含子查询的hint别名,同时任意表可以使用括号指定优先级,表之间使用空格分隔。 @@ -332,8 +320,6 @@ leading((t1 (t2 t3 t4) t5))表示: t2,t3,t4先join,内外表不限;在 leading((t1 (t2 t3) t4 t5)) leading((t3 t2))表示: t2,t3先join,t2做内表;然后再和t1 join,t2,t3的join表做内表;然后再依次跟t4,t5做join,t4,t5做内表。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -351,22 +337,16 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store ## Join方式的Hint -
- ### 功能描述 指明Join使用的方法,可以为Nested Loop,Hash Join和Merge Join。 -
- ### 语法格式 ``` [no] nestloop|hashjoin|mergejoin(table_list) ``` -
- ### 参数说明 - **no**表示hint的join方式不使用。 @@ -376,13 +356,11 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store no nestloop(t1 t2 t3)表示: 生成t1,t2,t3三表连接计划时,不使用nestloop。三表连接计划可能是t2 t3先join,再跟t1 join,或t1 t2先join,再跟t3 join。此hint只hint最后一次join的join方式,对于两表连接的方法不hint。如果需要,可以单独指定,例如: 任意表均不允许nestloop连接,且希望t2 t3先join,则增加hint: no nestloop(t2 t3)。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: -``` +```sql explain select /*+ nestloop(store_sales store_returns item) */ i_product_name product_name ... ``` @@ -395,22 +373,16 @@ select /*+ nestloop(store_sales store_returns item) */ i_product_name product_na ## 行数的Hint -
- ### 功能描述 指明中间结果集的大小,支持绝对值和相对值的hint。 -
- ### 语法格式 ```sql rows(table_list #|+|-|* const) ``` -
- ### 参数说明 - **#**,**+**,**-**,*****,进行行数估算hint的四种操作符号。#表示直接使用后面的行数进行hint。+,-,*表示对原来估算的行数进行加、减、乘操作,运算后的行数最小值为1行。table_list为hint对应的单表或多表join结果集,与Join方式的Hint中table_list相同。 @@ -422,15 +394,11 @@ rows(t1 #5)表示: 指定t1表的结果集为5行。 rows(t1 t2 t3 *1000)表示: 指定t1, t2, t3 join完的结果集的行数乘以1000。 -
- ### 建议 - 推荐使用两个表的hint。对于两个表的采用\*操作符的hint,只要两个表出现在join的两端,都会触发hint。例如: 设置hint为rows(t1 t2 * 3),对于(t1 t3 t4)和(t2 t5 t6)join时,由于t1和t2出现在join的两端,所以其join的结果集也会应用该hint规则乘以3。 - rows hint支持在单表、多表、function table及subquery scan table的结果集上指定hint。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -448,22 +416,16 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. ## Scan方式的Hint -
- ### 功能描述 指明scan使用的方法,可以是tablescan、indexscan和indexonlyscan。 -
- ### 语法格式 ```sql [no] tablescan|indexscan|indexonlyscan(table [index]) ``` -
- ### 参数说明 - **no**表示hint的scan方式不使用。 @@ -474,8 +436,6 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. > 对于indexscan或indexonlyscan,只有hint的索引属于hint的表时,才能使用该hint。 > scan hint支持在行列存表、obs表、子查询表上指定。 -
- ### 示例 为了hint使用索引扫描,需要首先在表item的i_item_sk列上创建索引,名称为i。 @@ -505,16 +465,12 @@ select /*+ indexscan(item i) */ i_product_name product_name ... 指明子链接块的名称。 -
- ### 语法格式 ```sql blockname (table) ``` -
- ### 参数说明 - **table**表示为该子链接块hint的别名的名称。 @@ -525,15 +481,13 @@ blockname (table) > - 对于FROM关键字后的子查询,则需要使用子查询的别名进行hint,blockname hint不会被用到。 > - 如果子链接中含有多个表,则提升后这些表可与外层表以任意优化顺序连接,hint也不会被用到。 -
- ### 示例 ```sql explain select /*+nestloop(store_sales tt) */ * from store_sales where ss_item_sk in (select /*+blockname(tt)*/ i_item_sk from item group by 1); ``` -该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: +该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: ![img](https://cdn-mogdb.enmotech.com/docs-media/mogdb/performance-tuning/hint-based-tuning-6.png) @@ -770,7 +724,7 @@ predpush_same_level(src1 src2 ..., dest) 准备参数和表及索引: -``` +```sql MogDB=# set rewrite_rule = 'predpushforce'; SET MogDB=# create table t1(a int, b int); @@ -785,7 +739,7 @@ CREATE INDEX 执行语句查看计划: -``` +```sql MogDB=# explain select * from t1, t2 where t1.a = t2.a; QUERY PLAN ------------------------------------------------------------------ @@ -799,7 +753,7 @@ MogDB=# explain select * from t1, t2 where t1.a = t2.a; 可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush_same_level(t1, t2)将条件下推至t2的扫描算子上: -``` +```sql MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a = t2.a; QUERY PLAN --------------------------------------------------------------------- @@ -814,3 +768,68 @@ MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a > > - predpush_same_level可以指定多个src,但是所有的src必须在同一个条件中。 > - 如果指定的src和dest条件不存在,或该条件不符合参数化路径要求,则本hint不生效。 + +## 不同层参数化路径的Hint + +### 功能描述 + +通过predpush Hint来指定不同层表或物化视图之间参数化路径生成。 + +### 语法格式 + +``` +predpush(src, dest) +predpush(src1 src2 ..., dest) +``` + +> **说明**:本参数仅在rewrite_rule中的predpushforce选项打开时生效。 + +### 示例 + +准备参数和表及索引: + +```sql +MogDB=# set rewrite_rule = 'predpushforce'; +SET +MogDB=# create table t1(a int, b int); +CREATE TABLE +MogDB=# create table t2(a int, b int); +CREATE TABLE +MogDB=# create index idx1 on t1(a); +CREATE INDEX +MogDB=# create index idx2 on t2(a); +CREATE INDEX +``` + +执行语句查看计划: + +```sql +MogDB=# explain select * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +------------------------------------------------------------------------ + Hash Join (cost=55.38..120.60 rows=2568 width=20) + Hash Cond: (t1.a = t2.a) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> Hash (cost=52.39..52.39 rows=239 width=12) + -> HashAggregate (cost=47.61..50.00 rows=239 width=12) + Group By Key: t2.a, t2.b + -> Seq Scan on t2 (cost=0.00..31.49 rows=2149 width=8) +(7 rows) +``` + +可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush(t1, ts)将条件下推至t2的扫描算子上: + +```sql +MogDB=# explain select /*+ predpush(t1, ts) */ * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +-------------------------------------------------------------------------------- + Nested Loop (cost=15.09..32586.69 rows=21 width=20) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> HashAggregate (cost=15.09..15.11 rows=2 width=12) + Group By Key: t2.a, t2.b + -> Bitmap Heap Scan on t2 (cost=4.34..15.01 rows=11 width=8) + Recheck Cond: (t1.a = a) + -> Bitmap Index Scan on idx2 (cost=0.00..4.33 rows=11 width=0) + Index Cond: (t1.a = a) +(8 rows) +``` \ No newline at end of file diff --git a/product/zh/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/zh/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index fafcacfb6dd458b94c5ffef33f489b6257c8460b..99ca1007f6b8fdbf7b50a06d2bf59b4c4a94f4f3 100644 --- a/product/zh/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/zh/docs-mogdb/v3.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意:** @@ -195,7 +195,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md b/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md index 729611a402d7a092742471564b75903450258973..087e71085ebb5b4cbf2a6a75dffcc0ef1e8dee84 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md @@ -145,7 +145,7 @@ date: 2021-04-20 - on表示可以同时记录主机名。 - off表示不可以同时记录主机名。 -**默认值**: on +**默认值**: off ## log_line_prefix diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md b/product/zh/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md index 648610454592d145cd6292aa93d436900c0648b1..587999577d03cf446b5fe89b8ff78143738c4fd1 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/supported-data-types/3-boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 - “真”值的有效文本值是: - TRUE、't'、'true'、'y'、'yes'、'1'、'TRUE'、true、整数范围内1\~2^63-1^、整数范围内-1\~-2^63^。 + TRUE、true、'TRUE'、'true'、'True'、't'、'YES'、'Yes'、'yes'、'1'、整数范围内1\~263-1、整数范围内-1\~-263。 - “假”值的有效文本值是: - FALSE、'f'、'false'、'n'、'no'、'0'、0、'FALSE'、false。 + FALSE、'f'、'false'、'False'、'n'、'no'、'No'、'0'、0、'FALSE'、false。 使用TRUE和FALSE是比较规范的用法(也是SQL兼容的用法)。 diff --git a/product/zh/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/zh/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index aa48c19a5be7527a610db2dacf505ee3bfb38de6..cab2c2f25f6075013484121ef55828de11b74fce 100644 --- a/product/zh/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/zh/docs-mogdb/v3.1/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ date: 2021-12-2 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意:** @@ -191,7 +191,7 @@ date: 2021-12-2 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/9-hint-based-tuning.md b/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/9-hint-based-tuning.md index ee4c375828e9e227a49ad7c65d08a4d99b8831b8..e7820e2af5487b0a0f8dd91b295f7dcfb82f34d8 100644 --- a/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/9-hint-based-tuning.md +++ b/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/9-hint-based-tuning.md @@ -13,7 +13,7 @@ date: 2021-03-04 Plan Hint为用户提供了直接影响执行计划生成的手段,用户可以通过指定join顺序,join、scan方法,指定结果行数,等多个手段来进行执行计划的调优,以提升查询的性能。 -
+MogDB还提供了SQL PATCH功能,在不修改业务语句的前提下通过创建SQL PATCH的方式使得Hint生效。 ### 功能描述 @@ -37,8 +37,6 @@ select /*+ */ * from t1, (select /*+ */ f > 如果在视图定义(CREATE VIEW)时指定hint,则在该视图每次被应用时会使用该hint。 > 当使用random plan功能(参数plan_mode_seed不为0)时,查询指定的plan hint不会被使用。 -
- ### 支持范围 当前版本Plan Hint支持的范围如下,后续版本会进行增强。 @@ -49,14 +47,10 @@ select /*+ */ * from t1, (select /*+ */ f - 指定Scan方式的Hint,仅支持常用的tablescan,indexscan和indexonlyscan的hint。 - 指定子链接块名的Hint -
- ### 注意事项 不支持Agg、Sort、Setop和Subplan的hint。 -
- ### 示例 本章节使用同一个语句进行示例,便于Plan Hint支持的各方法作对比,示例语句及不带hint的原计划如下所示: @@ -281,14 +275,10 @@ group by i_product_name ## Join顺序的Hint -
- ### 功能描述 指明join的顺序,包括内外表顺序。 -
- ### 语法格式 - 仅指定join顺序,不指定内外表顺序。 @@ -303,8 +293,6 @@ group by i_product_name leading((join_table_list)) ``` -
- ### 参数说明 join_table_list为表示表join顺序的hint字符串,可以包含当前层的任意个表(别名),或对于子查询提升的场景,也可以包含子查询的hint别名,同时任意表可以使用括号指定优先级,表之间使用空格分隔。 @@ -332,8 +320,6 @@ leading((t1 (t2 t3 t4) t5))表示: t2,t3,t4先join,内外表不限;在 leading((t1 (t2 t3) t4 t5)) leading((t3 t2))表示: t2,t3先join,t2做内表;然后再和t1 join,t2,t3的join表做内表;然后再依次跟t4,t5做join,t4,t5做内表。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -351,22 +337,16 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store ## Join方式的Hint -
- ### 功能描述 指明Join使用的方法,可以为Nested Loop,Hash Join和Merge Join。 -
- ### 语法格式 ``` [no] nestloop|hashjoin|mergejoin(table_list) ``` -
- ### 参数说明 - **no**表示hint的join方式不使用。 @@ -376,13 +356,11 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store no nestloop(t1 t2 t3)表示: 生成t1,t2,t3三表连接计划时,不使用nestloop。三表连接计划可能是t2 t3先join,再跟t1 join,或t1 t2先join,再跟t3 join。此hint只hint最后一次join的join方式,对于两表连接的方法不hint。如果需要,可以单独指定,例如: 任意表均不允许nestloop连接,且希望t2 t3先join,则增加hint: no nestloop(t2 t3)。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: -``` +```sql explain select /*+ nestloop(store_sales store_returns item) */ i_product_name product_name ... ``` @@ -395,22 +373,16 @@ select /*+ nestloop(store_sales store_returns item) */ i_product_name product_na ## 行数的Hint -
- ### 功能描述 指明中间结果集的大小,支持绝对值和相对值的hint。 -
- ### 语法格式 ```sql rows(table_list #|+|-|* const) ``` -
- ### 参数说明 - **#**,**+**,**-**,*****,进行行数估算hint的四种操作符号。#表示直接使用后面的行数进行hint。+,-,*表示对原来估算的行数进行加、减、乘操作,运算后的行数最小值为1行。table_list为hint对应的单表或多表join结果集,与Join方式的Hint中table_list相同。 @@ -422,15 +394,11 @@ rows(t1 #5)表示: 指定t1表的结果集为5行。 rows(t1 t2 t3 *1000)表示: 指定t1, t2, t3 join完的结果集的行数乘以1000。 -
- ### 建议 - 推荐使用两个表的hint。对于两个表的采用\*操作符的hint,只要两个表出现在join的两端,都会触发hint。例如: 设置hint为rows(t1 t2 * 3),对于(t1 t3 t4)和(t2 t5 t6)join时,由于t1和t2出现在join的两端,所以其join的结果集也会应用该hint规则乘以3。 - rows hint支持在单表、多表、function table及subquery scan table的结果集上指定hint。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -448,22 +416,16 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. ## Scan方式的Hint -
- ### 功能描述 指明scan使用的方法,可以是tablescan、indexscan和indexonlyscan。 -
- ### 语法格式 ```sql [no] tablescan|indexscan|indexonlyscan(table [index]) ``` -
- ### 参数说明 - **no**表示hint的scan方式不使用。 @@ -474,8 +436,6 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. > 对于indexscan或indexonlyscan,只有hint的索引属于hint的表时,才能使用该hint。 > scan hint支持在行列存表、obs表、子查询表上指定。 -
- ### 示例 为了hint使用索引扫描,需要首先在表item的i_item_sk列上创建索引,名称为i。 @@ -505,16 +465,12 @@ select /*+ indexscan(item i) */ i_product_name product_name ... 指明子链接块的名称。 -
- ### 语法格式 ```sql blockname (table) ``` -
- ### 参数说明 - **table**表示为该子链接块hint的别名的名称。 @@ -525,15 +481,13 @@ blockname (table) > - 对于FROM关键字后的子查询,则需要使用子查询的别名进行hint,blockname hint不会被用到。 > - 如果子链接中含有多个表,则提升后这些表可与外层表以任意优化顺序连接,hint也不会被用到。 -
- ### 示例 ```sql explain select /*+nestloop(store_sales tt) */ * from store_sales where ss_item_sk in (select /*+blockname(tt)*/ i_item_sk from item group by 1); ``` -该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: +该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: ![img](https://cdn-mogdb.enmotech.com/docs-media/mogdb/performance-tuning/hint-based-tuning-6.png) @@ -770,7 +724,7 @@ predpush_same_level(src1 src2 ..., dest) 准备参数和表及索引: -``` +```sql MogDB=# set rewrite_rule = 'predpushforce'; SET MogDB=# create table t1(a int, b int); @@ -785,7 +739,7 @@ CREATE INDEX 执行语句查看计划: -``` +```sql MogDB=# explain select * from t1, t2 where t1.a = t2.a; QUERY PLAN ------------------------------------------------------------------ @@ -799,7 +753,7 @@ MogDB=# explain select * from t1, t2 where t1.a = t2.a; 可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush_same_level(t1, t2)将条件下推至t2的扫描算子上: -``` +```sql MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a = t2.a; QUERY PLAN --------------------------------------------------------------------- @@ -815,6 +769,71 @@ MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a > - predpush_same_level可以指定多个src,但是所有的src必须在同一个条件中。 > - 如果指定的src和dest条件不存在,或该条件不符合参数化路径要求,则本hint不生效。 +## 不同层参数化路径的Hint + +### 功能描述 + +通过predpush Hint来指定不同层表或物化视图之间参数化路径生成。 + +### 语法格式 + +``` +predpush(src, dest) +predpush(src1 src2 ..., dest) +``` + +> **说明**:本参数仅在rewrite_rule中的predpushforce选项打开时生效。 + +### 示例 + +准备参数和表及索引: + +```sql +MogDB=# set rewrite_rule = 'predpushforce'; +SET +MogDB=# create table t1(a int, b int); +CREATE TABLE +MogDB=# create table t2(a int, b int); +CREATE TABLE +MogDB=# create index idx1 on t1(a); +CREATE INDEX +MogDB=# create index idx2 on t2(a); +CREATE INDEX +``` + +执行语句查看计划: + +```sql +MogDB=# explain select * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +------------------------------------------------------------------------ + Hash Join (cost=55.38..120.60 rows=2568 width=20) + Hash Cond: (t1.a = t2.a) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> Hash (cost=52.39..52.39 rows=239 width=12) + -> HashAggregate (cost=47.61..50.00 rows=239 width=12) + Group By Key: t2.a, t2.b + -> Seq Scan on t2 (cost=0.00..31.49 rows=2149 width=8) +(7 rows) +``` + +可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush(t1, ts)将条件下推至t2的扫描算子上: + +```sql +MogDB=# explain select /*+ predpush(t1, ts) */ * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +-------------------------------------------------------------------------------- + Nested Loop (cost=15.09..32586.69 rows=21 width=20) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> HashAggregate (cost=15.09..15.11 rows=2 width=12) + Group By Key: t2.a, t2.b + -> Bitmap Heap Scan on t2 (cost=4.34..15.01 rows=11 width=8) + Recheck Cond: (t1.a = a) + -> Bitmap Index Scan on idx2 (cost=0.00..4.33 rows=11 width=0) + Index Cond: (t1.a = a) +(8 rows) +``` + ## 将部分Error降级为Warning的Hint ### 功能描述 diff --git a/product/zh/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/zh/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index fafcacfb6dd458b94c5ffef33f489b6257c8460b..99ca1007f6b8fdbf7b50a06d2bf59b4c4a94f4f3 100644 --- a/product/zh/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/zh/docs-mogdb/v3.1/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意:** @@ -195,7 +195,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md b/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md index 3588717c427c62f1986be553286b61dc6ae0297a..5a0f5ea4c6d60385abbf73c19b23f1d96df54d7f 100644 --- a/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md +++ b/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/10-error-reporting-and-logging/3-logging-content.md @@ -145,7 +145,7 @@ date: 2021-04-20 - on表示可以同时记录主机名。 - off表示不可以同时记录主机名。 -**默认值**: on +**默认值**: off ## log_line_prefix diff --git a/product/zh/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md b/product/zh/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md index 648610454592d145cd6292aa93d436900c0648b1..587999577d03cf446b5fe89b8ff78143738c4fd1 100644 --- a/product/zh/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md +++ b/product/zh/docs-mogdb/v3.1/reference-guide/supported-data-types/3-boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 - “真”值的有效文本值是: - TRUE、't'、'true'、'y'、'yes'、'1'、'TRUE'、true、整数范围内1\~2^63-1^、整数范围内-1\~-2^63^。 + TRUE、true、'TRUE'、'true'、'True'、't'、'YES'、'Yes'、'yes'、'1'、整数范围内1\~263-1、整数范围内-1\~-263。 - “假”值的有效文本值是: - FALSE、'f'、'false'、'n'、'no'、'0'、0、'FALSE'、false。 + FALSE、'f'、'false'、'False'、'n'、'no'、'No'、'0'、0、'FALSE'、false。 使用TRUE和FALSE是比较规范的用法(也是SQL兼容的用法)。 diff --git a/product/zh/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/zh/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index 51cc73627d2b9c1cf84a8d5f93ca01e14013c082..8e18d9900c955885ccf6bf1330e59808bbfc03ba 100644 --- a/product/zh/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/zh/docs-mogdb/v5.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ date: 2021-12-2 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意**: @@ -191,7 +191,7 @@ date: 2021-12-2 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v5.0/developer-guide/plpgsql/1-4-arrays-and-records.md b/product/zh/docs-mogdb/v5.0/developer-guide/plpgsql/1-4-arrays-and-records.md index ce43dc3f037d67a37d3532b1a207e3853b62eced..bdae4db7f5283a03c412c5735b1d2c8cdfd437bb 100644 --- a/product/zh/docs-mogdb/v5.0/developer-guide/plpgsql/1-4-arrays-and-records.md +++ b/product/zh/docs-mogdb/v5.0/developer-guide/plpgsql/1-4-arrays-and-records.md @@ -130,7 +130,7 @@ MogDB支持使用圆括号来访问集合元素,且还支持一些特有的函 > - 不同的带索引集合类型的变量不能相互赋值。即使成员类型和下标类型相同,但集合类型名称不同,也是不同的集合类型。如 TYPE t1 IS TABLE OF int index by int; 和 TYPE t2 IS TABLE OF int index by int; 定义的两个集合类型,t1和t2是不同的集合类型,以其定义的变量不支持相互赋值。 > - 带索引集合类型不支持关系运算和算数运算操作。 > - select … bulk collect into 方式赋值带索引集合类型变量时,只支持下标为integer类型的集合类型,下标为varchar类型集合不支持。 -> - 支持带索引集合类型变量作为函数的参数和返回值,此时要求参数或者返回值的类型是在package中定义的集合类型。 +> - 支持带索引集合类型变量作为存储过程的参数,此时要求参数类型是在package中定义的集合类型。 > - 带索引的集合作为函数入参时,可以传入对应子元素类型相同的数组类型作为入参,不支持多维数组,不支持索引类型为varcahr(过时的方法,不建议使用该功能。可执行“set behavior_compat_options = 'disable_rewrite_nesttable';”禁用)。 > - 类型构造器目前仅支持集合类型,其参数个数的上限与用户自定义函数参数个数上限相同。对于带索引的集合类型,构造器在使用时索引的值仅支持为常量。 > - 不支持对XML类型数据操作。 @@ -150,9 +150,9 @@ BEGIN FOR I IN 1..10 LOOP TABLEINT(I) := I; END LOOP; - DBE_OUTPUT.PRINT_LINE(TABLEINT.COUNT); - DBE_OUTPUT.PRINT_LINE(TABLEINT(1)); - DBE_OUTPUT.PRINT_LINE(TABLEINT(10)); + RAISE NOTICE '%', TABLEINT.COUNT; + RAISE NOTICE '%', TABLEINT(1); + RAISE NOTICE '%', TABLEINT(10); END; / @@ -172,12 +172,11 @@ BEGIN NEST_TABLE_VAR.extend(10); FOR I IN 1..10 LOOP NEST_TABLE_VAR(I) := TABLE_INTEGER(); - NEST_TABLE_VAR(I).extend(10); NEST_TABLE_VAR(I)(I) := I; END LOOP; - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR.COUNT); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(1)(1)); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(10)(10)); + RAISE NOTICE '%', NEST_TABLE_VAR.COUNT; + RAISE NOTICE '%', NEST_TABLE_VAR(1)(1); + RAISE NOTICE '%', NEST_TABLE_VAR(10)(10); END; / @@ -198,18 +197,20 @@ DECLARE TYPE TABLE_VARCHAR IS TABLE OF INTEGER INDEX BY VARCHAR; --定义集合类型 TABLEINT_01 TABLE_INTEGER; --声明集合类型变量,未初始化 TABLEINT_02 TABLE_INTEGER := TABLE_INTEGER(); --声明集合类型变量,初始化为空 - TABLEINT_03 TABLE_INTEGER := TABLE_INTEGER(2=>3,3=>4); --声明集合类型变量,初始化指定值 + TABLEINT_03 TABLE_INTEGER := TABLE_INTEGER(); --声明集合类型变量,初始化为空 RES INTEGER; BEGIN + TABLEINT_03(2) := 3; --初始化指定值 + TABLEINT_03(3) := 4; --初始化指定值 FOR I IN 1..10 LOOP TABLEINT_01(I) := I; --成员赋值 TABLEINT_02(I) := I + 1; --成员赋值 END LOOP; TABLEINT_01 := TABLEINT_02; --整体赋值 RES := TABLEINT_03(2); --取值 - DBE_OUTPUT.PRINT_LINE(RES); - DBE_OUTPUT.PRINT_LINE(TABLEINT_01(1)); - DBE_OUTPUT.PRINT_LINE(TABLEINT_01(10)); + RAISE NOTICE '%', RES; + RAISE NOTICE '%', TABLEINT_01(1); + RAISE NOTICE '%', TABLEINT_01(10); END; / @@ -229,9 +230,9 @@ BEGIN FOR I IN 1..10 LOOP NEST_TABLE_VAR(I)(I) := I; END LOOP; - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR.COUNT); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(1)(1)); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(10)(10)); + RAISE NOTICE '%', NEST_TABLE_VAR.COUNT; + RAISE NOTICE '%', NEST_TABLE_VAR(1)(1); + RAISE NOTICE '%', NEST_TABLE_VAR(10)(10); END; / diff --git a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/hint-based-tuning.md b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/hint-based-tuning.md index 912f55d062c05d6c8e39a21f6c60cc67e35f6667..769217c31c576e73c5814a535786c50a077001f0 100644 --- a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/hint-based-tuning.md +++ b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/hint-based-tuning.md @@ -15,8 +15,6 @@ Plan Hint为用户提供了直接影响执行计划生成的手段,用户可 MogDB还提供了SQL PATCH功能,在不修改业务语句的前提下通过创建SQL PATCH的方式使得Hint生效。 -
- ### 功能描述 Plan Hint支持在SELECT关键字后通过如下形式指定: @@ -39,8 +37,6 @@ select /*+ */ * from t1, (select /*+ */ f > 如果在视图定义(CREATE VIEW)时指定hint,则在该视图每次被应用时会使用该hint。 > 当使用random plan功能(参数plan_mode_seed不为0)时,查询指定的plan hint不会被使用。 -
- ### 支持范围 当前版本Plan Hint支持的范围如下,后续版本会进行增强。 @@ -51,14 +47,10 @@ select /*+ */ * from t1, (select /*+ */ f - 指定Scan方式的Hint,仅支持常用的tablescan,indexscan和indexonlyscan的hint。 - 指定子链接块名的Hint -
- ### 注意事项 不支持Agg、Sort、Setop和Subplan的hint。 -
- ### 示例 本章节使用同一个语句进行示例,便于Plan Hint支持的各方法作对比,示例语句及不带hint的原计划如下所示: @@ -283,14 +275,10 @@ group by i_product_name ## Join顺序的Hint -
- ### 功能描述 指明join的顺序,包括内外表顺序。 -
- ### 语法格式 - 仅指定join顺序,不指定内外表顺序。 @@ -305,8 +293,6 @@ group by i_product_name leading((join_table_list)) ``` -
- ### 参数说明 join_table_list为表示表join顺序的hint字符串,可以包含当前层的任意个表(别名),或对于子查询提升的场景,也可以包含子查询的hint别名,同时任意表可以使用括号指定优先级,表之间使用空格分隔。 @@ -334,8 +320,6 @@ leading((t1 (t2 t3 t4) t5))表示: t2,t3,t4先join,内外表不限;在 leading((t1 (t2 t3) t4 t5)) leading((t3 t2))表示: t2,t3先join,t2做内表;然后再和t1 join,t2,t3的join表做内表;然后再依次跟t4,t5做join,t4,t5做内表。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -353,22 +337,16 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store ## Join方式的Hint -
- ### 功能描述 指明Join使用的方法,可以为Nested Loop,Hash Join和Merge Join。 -
- ### 语法格式 ``` [no] nestloop|hashjoin|mergejoin(table_list) ``` -
- ### 参数说明 - **no**表示hint的join方式不使用。 @@ -378,13 +356,11 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store no nestloop(t1 t2 t3)表示: 生成t1,t2,t3三表连接计划时,不使用nestloop。三表连接计划可能是t2 t3先join,再跟t1 join,或t1 t2先join,再跟t3 join。此hint只hint最后一次join的join方式,对于两表连接的方法不hint。如果需要,可以单独指定,例如: 任意表均不允许nestloop连接,且希望t2 t3先join,则增加hint: no nestloop(t2 t3)。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: -``` +```sql explain select /*+ nestloop(store_sales store_returns item) */ i_product_name product_name ... ``` @@ -397,22 +373,16 @@ select /*+ nestloop(store_sales store_returns item) */ i_product_name product_na ## 行数的Hint -
- ### 功能描述 指明中间结果集的大小,支持绝对值和相对值的hint。 -
- ### 语法格式 ```sql rows(table_list #|+|-|* const) ``` -
- ### 参数说明 - **#**,**+**,**-**,*****,进行行数估算hint的四种操作符号。#表示直接使用后面的行数进行hint。+,-,*表示对原来估算的行数进行加、减、乘操作,运算后的行数最小值为1行。table_list为hint对应的单表或多表join结果集,与Join方式的Hint中table_list相同。 @@ -424,15 +394,11 @@ rows(t1 #5)表示: 指定t1表的结果集为5行。 rows(t1 t2 t3 *1000)表示: 指定t1, t2, t3 join完的结果集的行数乘以1000。 -
- ### 建议 - 推荐使用两个表的hint。对于两个表的采用\*操作符的hint,只要两个表出现在join的两端,都会触发hint。例如: 设置hint为rows(t1 t2 * 3),对于(t1 t3 t4)和(t2 t5 t6)join时,由于t1和t2出现在join的两端,所以其join的结果集也会应用该hint规则乘以3。 - rows hint支持在单表、多表、function table及subquery scan table的结果集上指定hint。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -450,22 +416,16 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. ## Scan方式的Hint -
- ### 功能描述 指明scan使用的方法,可以是tablescan、indexscan和indexonlyscan。 -
- ### 语法格式 ```sql [no] tablescan|indexscan|indexonlyscan(table [index]) ``` -
- ### 参数说明 - **no**表示hint的scan方式不使用。 @@ -476,8 +436,6 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. > 对于indexscan或indexonlyscan,只有hint的索引属于hint的表时,才能使用该hint。 > scan hint支持在行列存表、obs表、子查询表上指定。 -
- ### 示例 为了hint使用索引扫描,需要首先在表item的i_item_sk列上创建索引,名称为i。 @@ -501,8 +459,6 @@ select /*+ indexscan(item i) */ i_product_name product_name ... ## INDEX HINTS -
- ### 注意事项 兼容限制: @@ -511,18 +467,14 @@ select /*+ indexscan(item i) */ i_product_name product_name ... - 目前仅支持MySql数据库中完整语法的部分语法及功能。 - 语法仅在查询语句中使用此功能时生效。 -
- ### 功能描述 为指定的表在扫描时显示的指定期望使用的索引名称。 -- 使用USE INDEX 指定的索引,会在扫描时综合考虑使用此索引扫描的代价和顺序扫描的代价,会选择代价更低的使用。 -- 使用FORCE INDEX 指定的索引,如果可以使用索引扫描,会在扫描时强制使用此索引进行扫描。 -- FORCE INDEX 和USE INDEX 不能同时作用在同一张表中。 -- 多个index_hint 连用等价index_list 中写多个索引名字。 - -
+- 使用USE INDEX指定的索引,会在扫描时综合考虑使用此索引扫描的代价和顺序扫描的代价,会选择代价更低的使用。 +- 使用FORCE INDEX指定的索引,如果可以使用索引扫描,会在扫描时强制使用此索引进行扫描。 +- FORCE INDEX和USE INDEX不能同时作用在同一张表中。 +- 多个index_hint连用等价index_list中写多个索引名字。 ### 语法格式 @@ -538,8 +490,6 @@ index_list: index_name [ , index_name ] ... ``` -
- ### 参数说明 - **index_list** @@ -550,8 +500,6 @@ index_list: 泛指一个表名。 -
- ### 示例 ```sql @@ -569,22 +517,16 @@ MogDB=# explain (costs off,verbose true )select * from db_1097149_tb force key ## 子链接块名的hint -
- ### 功能描述 指明子链接块的名称。 -
- ### 语法格式 ```sql blockname (table) ``` -
- ### 参数说明 - **table**表示为该子链接块hint的别名的名称。 @@ -595,15 +537,13 @@ blockname (table) > - 对于FROM关键字后的子查询,则需要使用子查询的别名进行hint,blockname hint不会被用到。 > - 如果子链接中含有多个表,则提升后这些表可与外层表以任意优化顺序连接,hint也不会被用到。 -
- ### 示例 ```sql explain select /*+nestloop(store_sales tt) */ * from store_sales where ss_item_sk in (select /*+blockname(tt)*/ i_item_sk from item group by 1); ``` -该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: +该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: ![img](https://cdn-mogdb.enmotech.com/docs-media/mogdb/performance-tuning/hint-based-tuning-6.png) @@ -840,7 +780,7 @@ predpush_same_level(src1 src2 ..., dest) 准备参数和表及索引: -``` +```sql MogDB=# set rewrite_rule = 'predpushforce'; SET MogDB=# create table t1(a int, b int); @@ -855,7 +795,7 @@ CREATE INDEX 执行语句查看计划: -``` +```sql MogDB=# explain select * from t1, t2 where t1.a = t2.a; QUERY PLAN ------------------------------------------------------------------ @@ -869,7 +809,7 @@ MogDB=# explain select * from t1, t2 where t1.a = t2.a; 可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush_same_level(t1, t2)将条件下推至t2的扫描算子上: -``` +```sql MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a = t2.a; QUERY PLAN --------------------------------------------------------------------- @@ -885,6 +825,71 @@ MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a > - predpush_same_level可以指定多个src,但是所有的src必须在同一个条件中。 > - 如果指定的src和dest条件不存在,或该条件不符合参数化路径要求,则本hint不生效。 +## 不同层参数化路径的Hint + +### 功能描述 + +通过predpush Hint来指定不同层表或物化视图之间参数化路径生成。 + +### 语法格式 + +``` +predpush(src, dest) +predpush(src1 src2 ..., dest) +``` + +> **说明**:本参数仅在rewrite_rule中的predpushforce选项打开时生效。 + +### 示例 + +准备参数和表及索引: + +```sql +MogDB=# set rewrite_rule = 'predpushforce'; +SET +MogDB=# create table t1(a int, b int); +CREATE TABLE +MogDB=# create table t2(a int, b int); +CREATE TABLE +MogDB=# create index idx1 on t1(a); +CREATE INDEX +MogDB=# create index idx2 on t2(a); +CREATE INDEX +``` + +执行语句查看计划: + +```sql +MogDB=# explain select * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +------------------------------------------------------------------------ + Hash Join (cost=55.38..120.60 rows=2568 width=20) + Hash Cond: (t1.a = t2.a) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> Hash (cost=52.39..52.39 rows=239 width=12) + -> HashAggregate (cost=47.61..50.00 rows=239 width=12) + Group By Key: t2.a, t2.b + -> Seq Scan on t2 (cost=0.00..31.49 rows=2149 width=8) +(7 rows) +``` + +可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush(t1, ts)将条件下推至t2的扫描算子上: + +```sql +MogDB=# explain select /*+ predpush(t1, ts) */ * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +-------------------------------------------------------------------------------- + Nested Loop (cost=15.09..32586.69 rows=21 width=20) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> HashAggregate (cost=15.09..15.11 rows=2 width=12) + Group By Key: t2.a, t2.b + -> Bitmap Heap Scan on t2 (cost=4.34..15.01 rows=11 width=8) + Recheck Cond: (t1.a = a) + -> Bitmap Index Scan on idx2 (cost=0.00..4.33 rows=11 width=0) + Index Cond: (t1.a = a) +(8 rows) +``` + ## 将部分Error降级为Warning的Hint ### 功能描述 diff --git a/product/zh/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/zh/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index b3c1cdacabb1dfd36111b859d2591c4eb49c6929..cf0fc293a03618944848b3f76096369c8ada685b 100644 --- a/product/zh/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/zh/docs-mogdb/v5.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意**: @@ -195,7 +195,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md b/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md index 57fc094db83e0156431357ce523d2bc17ca4f4a0..72ba422d6aa73dd2df2d4539e2128d766cc9a601 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md @@ -145,7 +145,7 @@ date: 2021-04-20 - on表示可以同时记录主机名。 - off表示不可以同时记录主机名。 -**默认值**: on +**默认值**: off ## log_line_prefix diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md b/product/zh/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md index 648610454592d145cd6292aa93d436900c0648b1..587999577d03cf446b5fe89b8ff78143738c4fd1 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/supported-data-types/boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 - “真”值的有效文本值是: - TRUE、't'、'true'、'y'、'yes'、'1'、'TRUE'、true、整数范围内1\~2^63-1^、整数范围内-1\~-2^63^。 + TRUE、true、'TRUE'、'true'、'True'、't'、'YES'、'Yes'、'yes'、'1'、整数范围内1\~263-1、整数范围内-1\~-263。 - “假”值的有效文本值是: - FALSE、'f'、'false'、'n'、'no'、'0'、0、'FALSE'、false。 + FALSE、'f'、'false'、'False'、'n'、'no'、'No'、'0'、0、'FALSE'、false。 使用TRUE和FALSE是比较规范的用法(也是SQL兼容的用法)。 diff --git a/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md b/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md index 6aa5fd9cdc5d8b6a7dcda9c9450d1d3d6d28ecf9..ab6794298f70a0246a9b5019830f3bbcc4be0810 100644 --- a/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md +++ b/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query-planning/other-optimizer-options.md @@ -173,7 +173,7 @@ set rewrite_rule = none; --关闭所有可选查询重写规则 - intargetlist:使用In Target List查询重写规则(提升目标列中的子查询)。 - predpushnormal:使用Predicate Push查询重写规则(下推谓词条件到子查询中)。 - predpushforce:使用Predicate Push查询重写规则(下推谓词条件到子查询中,尽可能的利用索引加速)。 -- predpush:在predpushnormal和predpushforce中根据代价选择最优计划。 +- predpush:在predpushnormal和predpushforce中根据代价选择最优计划。**注**:predpush类的重写规则在极个别场景会导致无法生成合法的计划,在启用参数前建议进行充分测试。 - reduce_orderby:使用reduce orderby查询重写规则(删除子查询中不必要的排序)。 - column_pruner:使用column_pruner查询重写规则(列裁剪消除子查询中冗余的投影列,支持A/PG兼容模式)。 diff --git a/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md b/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md index 81f25e9847c5d5749e3052cfcc0e9f480bd712a6..13d34138f528261852e60727ee00818ac18e0165 100644 --- a/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md +++ b/product/zh/docs-mogdb/v5.2/reference-guide/guc-parameters/query.md @@ -37,7 +37,8 @@ date: 2021-04-20 **取值范围**: 枚举类型 -top:只记录顶层SQL。 +- top:只记录顶层SQL。 +- all: 代表记录全部的SQL(包括存储过程及函数内的sql语句)。 **默认值**: top diff --git a/product/zh/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md b/product/zh/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md index 51cc73627d2b9c1cf84a8d5f93ca01e14013c082..8e18d9900c955885ccf6bf1330e59808bbfc03ba 100644 --- a/product/zh/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md +++ b/product/zh/docs-mogdb/v6.0/administrator-guide/routine-maintenance/using-the-gsql-client-for-connection.md @@ -170,7 +170,7 @@ date: 2021-12-2 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意**: @@ -191,7 +191,7 @@ date: 2021-12-2 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v6.0/developer-guide/plpgsql/1-4-arrays-and-records.md b/product/zh/docs-mogdb/v6.0/developer-guide/plpgsql/1-4-arrays-and-records.md index ce43dc3f037d67a37d3532b1a207e3853b62eced..bdae4db7f5283a03c412c5735b1d2c8cdfd437bb 100644 --- a/product/zh/docs-mogdb/v6.0/developer-guide/plpgsql/1-4-arrays-and-records.md +++ b/product/zh/docs-mogdb/v6.0/developer-guide/plpgsql/1-4-arrays-and-records.md @@ -130,7 +130,7 @@ MogDB支持使用圆括号来访问集合元素,且还支持一些特有的函 > - 不同的带索引集合类型的变量不能相互赋值。即使成员类型和下标类型相同,但集合类型名称不同,也是不同的集合类型。如 TYPE t1 IS TABLE OF int index by int; 和 TYPE t2 IS TABLE OF int index by int; 定义的两个集合类型,t1和t2是不同的集合类型,以其定义的变量不支持相互赋值。 > - 带索引集合类型不支持关系运算和算数运算操作。 > - select … bulk collect into 方式赋值带索引集合类型变量时,只支持下标为integer类型的集合类型,下标为varchar类型集合不支持。 -> - 支持带索引集合类型变量作为函数的参数和返回值,此时要求参数或者返回值的类型是在package中定义的集合类型。 +> - 支持带索引集合类型变量作为存储过程的参数,此时要求参数类型是在package中定义的集合类型。 > - 带索引的集合作为函数入参时,可以传入对应子元素类型相同的数组类型作为入参,不支持多维数组,不支持索引类型为varcahr(过时的方法,不建议使用该功能。可执行“set behavior_compat_options = 'disable_rewrite_nesttable';”禁用)。 > - 类型构造器目前仅支持集合类型,其参数个数的上限与用户自定义函数参数个数上限相同。对于带索引的集合类型,构造器在使用时索引的值仅支持为常量。 > - 不支持对XML类型数据操作。 @@ -150,9 +150,9 @@ BEGIN FOR I IN 1..10 LOOP TABLEINT(I) := I; END LOOP; - DBE_OUTPUT.PRINT_LINE(TABLEINT.COUNT); - DBE_OUTPUT.PRINT_LINE(TABLEINT(1)); - DBE_OUTPUT.PRINT_LINE(TABLEINT(10)); + RAISE NOTICE '%', TABLEINT.COUNT; + RAISE NOTICE '%', TABLEINT(1); + RAISE NOTICE '%', TABLEINT(10); END; / @@ -172,12 +172,11 @@ BEGIN NEST_TABLE_VAR.extend(10); FOR I IN 1..10 LOOP NEST_TABLE_VAR(I) := TABLE_INTEGER(); - NEST_TABLE_VAR(I).extend(10); NEST_TABLE_VAR(I)(I) := I; END LOOP; - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR.COUNT); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(1)(1)); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(10)(10)); + RAISE NOTICE '%', NEST_TABLE_VAR.COUNT; + RAISE NOTICE '%', NEST_TABLE_VAR(1)(1); + RAISE NOTICE '%', NEST_TABLE_VAR(10)(10); END; / @@ -198,18 +197,20 @@ DECLARE TYPE TABLE_VARCHAR IS TABLE OF INTEGER INDEX BY VARCHAR; --定义集合类型 TABLEINT_01 TABLE_INTEGER; --声明集合类型变量,未初始化 TABLEINT_02 TABLE_INTEGER := TABLE_INTEGER(); --声明集合类型变量,初始化为空 - TABLEINT_03 TABLE_INTEGER := TABLE_INTEGER(2=>3,3=>4); --声明集合类型变量,初始化指定值 + TABLEINT_03 TABLE_INTEGER := TABLE_INTEGER(); --声明集合类型变量,初始化为空 RES INTEGER; BEGIN + TABLEINT_03(2) := 3; --初始化指定值 + TABLEINT_03(3) := 4; --初始化指定值 FOR I IN 1..10 LOOP TABLEINT_01(I) := I; --成员赋值 TABLEINT_02(I) := I + 1; --成员赋值 END LOOP; TABLEINT_01 := TABLEINT_02; --整体赋值 RES := TABLEINT_03(2); --取值 - DBE_OUTPUT.PRINT_LINE(RES); - DBE_OUTPUT.PRINT_LINE(TABLEINT_01(1)); - DBE_OUTPUT.PRINT_LINE(TABLEINT_01(10)); + RAISE NOTICE '%', RES; + RAISE NOTICE '%', TABLEINT_01(1); + RAISE NOTICE '%', TABLEINT_01(10); END; / @@ -229,9 +230,9 @@ BEGIN FOR I IN 1..10 LOOP NEST_TABLE_VAR(I)(I) := I; END LOOP; - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR.COUNT); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(1)(1)); - DBE_OUTPUT.PRINT_LINE(NEST_TABLE_VAR(10)(10)); + RAISE NOTICE '%', NEST_TABLE_VAR.COUNT; + RAISE NOTICE '%', NEST_TABLE_VAR(1)(1); + RAISE NOTICE '%', NEST_TABLE_VAR(10)(10); END; / diff --git a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/hint-based-tuning.md b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/hint-based-tuning.md index 4945344238de9c31967283c0924c1b9711cf68a6..32c2e056c8e2970688c465a3ae53f9865cb36611 100644 --- a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/hint-based-tuning.md +++ b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/hint-based-tuning.md @@ -15,8 +15,6 @@ Plan Hint为用户提供了直接影响执行计划生成的手段,用户可 MogDB还提供了SQL PATCH功能,在不修改业务语句的前提下通过创建SQL PATCH的方式使得Hint生效。 -
- ### 功能描述 Plan Hint支持在SELECT关键字后通过如下形式指定: @@ -39,8 +37,6 @@ select /*+ */ * from t1, (select /*+ */ f > 如果在视图定义(CREATE VIEW)时指定hint,则在该视图每次被应用时会使用该hint。 > 当使用random plan功能(参数plan_mode_seed不为0)时,查询指定的plan hint不会被使用。 -
- ### 支持范围 当前版本Plan Hint支持的范围如下,后续版本会进行增强。 @@ -51,14 +47,10 @@ select /*+ */ * from t1, (select /*+ */ f - 指定Scan方式的Hint,仅支持常用的tablescan,indexscan和indexonlyscan的hint。 - 指定子链接块名的Hint -
- ### 注意事项 不支持Agg、Sort、Setop和Subplan的hint。 -
- ### 示例 本章节使用同一个语句进行示例,便于Plan Hint支持的各方法作对比,示例语句及不带hint的原计划如下所示: @@ -283,14 +275,10 @@ group by i_product_name ## Join顺序的Hint -
- ### 功能描述 指明join的顺序,包括内外表顺序。 -
- ### 语法格式 - 仅指定join顺序,不指定内外表顺序。 @@ -305,8 +293,6 @@ group by i_product_name leading((join_table_list)) ``` -
- ### 参数说明 join_table_list为表示表join顺序的hint字符串,可以包含当前层的任意个表(别名),或对于子查询提升的场景,也可以包含子查询的hint别名,同时任意表可以使用括号指定优先级,表之间使用空格分隔。 @@ -334,8 +320,6 @@ leading((t1 (t2 t3 t4) t5))表示: t2,t3,t4先join,内外表不限;在 leading((t1 (t2 t3) t4 t5)) leading((t3 t2))表示: t2,t3先join,t2做内表;然后再和t1 join,t2,t3的join表做内表;然后再依次跟t4,t5做join,t4,t5做内表。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -353,22 +337,16 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store ## Join方式的Hint -
- ### 功能描述 指明Join使用的方法,可以为Nested Loop,Hash Join和Merge Join。 -
- ### 语法格式 ``` [no] nestloop|hashjoin|mergejoin(table_list) ``` -
- ### 参数说明 - **no**表示hint的join方式不使用。 @@ -378,13 +356,11 @@ select /*+ leading((((((store_sales store) promotion) item) customer) ad2) store no nestloop(t1 t2 t3)表示: 生成t1,t2,t3三表连接计划时,不使用nestloop。三表连接计划可能是t2 t3先join,再跟t1 join,或t1 t2先join,再跟t3 join。此hint只hint最后一次join的join方式,对于两表连接的方法不hint。如果需要,可以单独指定,例如: 任意表均不允许nestloop连接,且希望t2 t3先join,则增加hint: no nestloop(t2 t3)。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: -``` +```sql explain select /*+ nestloop(store_sales store_returns item) */ i_product_name product_name ... ``` @@ -397,22 +373,16 @@ select /*+ nestloop(store_sales store_returns item) */ i_product_name product_na ## 行数的Hint -
- ### 功能描述 指明中间结果集的大小,支持绝对值和相对值的hint。 -
- ### 语法格式 ```sql rows(table_list #|+|-|* const) ``` -
- ### 参数说明 - **#**,**+**,**-**,*****,进行行数估算hint的四种操作符号。#表示直接使用后面的行数进行hint。+,-,*表示对原来估算的行数进行加、减、乘操作,运算后的行数最小值为1行。table_list为hint对应的单表或多表join结果集,与Join方式的Hint中table_list相同。 @@ -424,15 +394,11 @@ rows(t1 #5)表示: 指定t1表的结果集为5行。 rows(t1 t2 t3 *1000)表示: 指定t1, t2, t3 join完的结果集的行数乘以1000。 -
- ### 建议 - 推荐使用两个表的hint。对于两个表的采用\*操作符的hint,只要两个表出现在join的两端,都会触发hint。例如: 设置hint为rows(t1 t2 * 3),对于(t1 t3 t4)和(t2 t5 t6)join时,由于t1和t2出现在join的两端,所以其join的结果集也会应用该hint规则乘以3。 - rows hint支持在单表、多表、function table及subquery scan table的结果集上指定hint。 -
- ### 示例 对[示例](#示例)中原语句使用如下hint: @@ -450,22 +416,16 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. ## Scan方式的Hint -
- ### 功能描述 指明scan使用的方法,可以是tablescan、indexscan和indexonlyscan。 -
- ### 语法格式 ```sql [no] tablescan|indexscan|indexonlyscan(table [index]) ``` -
- ### 参数说明 - **no**表示hint的scan方式不使用。 @@ -476,8 +436,6 @@ select /*+ rows(store_sales store_returns *50) */ i_product_name product_name .. > 对于indexscan或indexonlyscan,只有hint的索引属于hint的表时,才能使用该hint。 > scan hint支持在行列存表、obs表、子查询表上指定。 -
- ### 示例 为了hint使用索引扫描,需要首先在表item的i_item_sk列上创建索引,名称为i。 @@ -501,8 +459,6 @@ select /*+ indexscan(item i) */ i_product_name product_name ... ## INDEX HINTS -
- ### 注意事项 兼容限制: @@ -511,8 +467,6 @@ select /*+ indexscan(item i) */ i_product_name product_name ... - 目前仅支持MySql数据库中完整语法的部分语法及功能。 - 语法仅在查询语句中使用此功能时生效。 -
- ### 功能描述 为指定的表在扫描时显示的指定期望使用的索引名称。 @@ -539,8 +493,6 @@ index_list: index_name [ , index_name ] ... ``` -
- ### 参数说明 - **index_list** @@ -551,8 +503,6 @@ index_list: 泛指一个表名。 -
- ### 示例 ```sql @@ -577,22 +527,16 @@ MogDB=# explain (costs off) select * from db_1130449_tb IGNORE INDEX (index_1130 ## 子链接块名的hint -
- ### 功能描述 指明子链接块的名称。 -
- ### 语法格式 ```sql blockname (table) ``` -
- ### 参数说明 - **table**表示为该子链接块hint的别名的名称。 @@ -603,15 +547,13 @@ blockname (table) > - 对于FROM关键字后的子查询,则需要使用子查询的别名进行hint,blockname hint不会被用到。 > - 如果子链接中含有多个表,则提升后这些表可与外层表以任意优化顺序连接,hint也不会被用到。 -
- ### 示例 ```sql explain select /*+nestloop(store_sales tt) */ * from store_sales where ss_item_sk in (select /*+blockname(tt)*/ i_item_sk from item group by 1); ``` -该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: +该hint表示: 子链接的别名为tt,提升后与上层的store_sales表关联时使用nestloop。生成计划如下所示: ![img](https://cdn-mogdb.enmotech.com/docs-media/mogdb/performance-tuning/hint-based-tuning-6.png) @@ -848,7 +790,7 @@ predpush_same_level(src1 src2 ..., dest) 准备参数和表及索引: -``` +```sql MogDB=# set rewrite_rule = 'predpushforce'; SET MogDB=# create table t1(a int, b int); @@ -863,7 +805,7 @@ CREATE INDEX 执行语句查看计划: -``` +```sql MogDB=# explain select * from t1, t2 where t1.a = t2.a; QUERY PLAN ------------------------------------------------------------------ @@ -877,7 +819,7 @@ MogDB=# explain select * from t1, t2 where t1.a = t2.a; 可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush_same_level(t1, t2)将条件下推至t2的扫描算子上: -``` +```sql MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a = t2.a; QUERY PLAN --------------------------------------------------------------------- @@ -893,6 +835,71 @@ MogDB=# explain select /*+predpush_same_level(t1, t2)*/ * from t1, t2 where t1.a > - predpush_same_level可以指定多个src,但是所有的src必须在同一个条件中。 > - 如果指定的src和dest条件不存在,或该条件不符合参数化路径要求,则本hint不生效。 +## 不同层参数化路径的Hint + +### 功能描述 + +通过predpush Hint来指定不同层表或物化视图之间参数化路径生成。 + +### 语法格式 + +``` +predpush(src, dest) +predpush(src1 src2 ..., dest) +``` + +> **说明**:本参数仅在rewrite_rule中的predpushforce选项打开时生效。 + +### 示例 + +准备参数和表及索引: + +```sql +MogDB=# set rewrite_rule = 'predpushforce'; +SET +MogDB=# create table t1(a int, b int); +CREATE TABLE +MogDB=# create table t2(a int, b int); +CREATE TABLE +MogDB=# create index idx1 on t1(a); +CREATE INDEX +MogDB=# create index idx2 on t2(a); +CREATE INDEX +``` + +执行语句查看计划: + +```sql +MogDB=# explain select * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +------------------------------------------------------------------------ + Hash Join (cost=55.38..120.60 rows=2568 width=20) + Hash Cond: (t1.a = t2.a) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> Hash (cost=52.39..52.39 rows=239 width=12) + -> HashAggregate (cost=47.61..50.00 rows=239 width=12) + Group By Key: t2.a, t2.b + -> Seq Scan on t2 (cost=0.00..31.49 rows=2149 width=8) +(7 rows) +``` + +可以看到t1.a = t2.a条件过滤在Join上面,此时可以通过predpush(t1, ts)将条件下推至t2的扫描算子上: + +```sql +MogDB=# explain select /*+ predpush(t1, ts) */ * from t1,(select a, b, min(a) from t2 group by 1,2) ts where t1.a = ts.a; + QUERY PLAN +-------------------------------------------------------------------------------- + Nested Loop (cost=15.09..32586.69 rows=21 width=20) + -> Seq Scan on t1 (cost=0.00..31.49 rows=2149 width=8) + -> HashAggregate (cost=15.09..15.11 rows=2 width=12) + Group By Key: t2.a, t2.b + -> Bitmap Heap Scan on t2 (cost=4.34..15.01 rows=11 width=8) + Recheck Cond: (t1.a = a) + -> Bitmap Index Scan on idx2 (cost=0.00..4.33 rows=11 width=0) + Index Cond: (t1.a = a) +(8 rows) +``` + ## 将部分Error降级为Warning的Hint ### 功能描述 diff --git a/product/zh/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md b/product/zh/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md index b3c1cdacabb1dfd36111b859d2591c4eb49c6929..cf0fc293a03618944848b3f76096369c8ada685b 100644 --- a/product/zh/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md +++ b/product/zh/docs-mogdb/v6.0/quick-start/mogdb-access/use-cli-to-access-mogdb/gsql.md @@ -174,7 +174,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 例如,下面示例中配置允许IP地址为172.16.0.245的客户端访问本机。 ```bash - gs_guc set -N all -I all -h "host all jack 172.16.0.245/24 sha256" + gs_guc set -N all -I all -h "host all jack 172.16.0.245/32 sha256" ``` **注意**: @@ -195,7 +195,7 @@ gsql是MogDB提供的在命令行下运行的数据库连接工具。此工具 - jack表示连接数据库的用户。 - - 172.16.0.245/24表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。24表示子网掩码为1的位数,即255.255.255.0。 + - 172.16.0.245/32表示只允许IP地址为172.16.0.245的主机连接。此处的IP地址不能为MogDB内的IP,在使用过程中,请根据用户的网络进行配置修改。32表示子网掩码为1的位数,即255.255.255.255。 - sha256表示连接时jack用户的密码使用sha256算法加密。 diff --git a/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md b/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md index 1454c0bd78ec256fab11965bed83bc887fdc2d00..ae6d44c01b25db8d7af3c7383dd1daac9a5a2e53 100644 --- a/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md +++ b/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/error-reporting-and-logging/logging-content.md @@ -145,7 +145,7 @@ date: 2021-04-20 - on表示可以同时记录主机名。 - off表示不可以同时记录主机名。 -**默认值**: on +**默认值**: off ## log_line_prefix diff --git a/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md b/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md index 0531988848a72c2227fbb8baf574d518833b7cc8..c6f37e19f33f9fb2a4b07a9e83bdf3a3e01a0f8b 100644 --- a/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md +++ b/product/zh/docs-mogdb/v6.0/reference-guide/guc-parameters/query.md @@ -37,7 +37,8 @@ date: 2021-04-20 **取值范围**: 枚举类型 -top:只记录顶层SQL。 +- top:只记录顶层SQL。 +- all: 代表记录全部的SQL(包括存储过程及函数内的sql语句)。 **默认值**: top diff --git a/product/zh/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md b/product/zh/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md index 648610454592d145cd6292aa93d436900c0648b1..587999577d03cf446b5fe89b8ff78143738c4fd1 100644 --- a/product/zh/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md +++ b/product/zh/docs-mogdb/v6.0/reference-guide/supported-data-types/boolean-data-types.md @@ -15,11 +15,11 @@ date: 2021-04-06 - “真”值的有效文本值是: - TRUE、't'、'true'、'y'、'yes'、'1'、'TRUE'、true、整数范围内1\~2^63-1^、整数范围内-1\~-2^63^。 + TRUE、true、'TRUE'、'true'、'True'、't'、'YES'、'Yes'、'yes'、'1'、整数范围内1\~263-1、整数范围内-1\~-263。 - “假”值的有效文本值是: - FALSE、'f'、'false'、'n'、'no'、'0'、0、'FALSE'、false。 + FALSE、'f'、'false'、'False'、'n'、'no'、'No'、'0'、0、'FALSE'、false。 使用TRUE和FALSE是比较规范的用法(也是SQL兼容的用法)。