From 02edb5b562572c72d77e5c82a870c263541cf83b Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 23 Aug 2024 17:35:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix(mogdb):dolphin=E6=B7=BB=E5=8A=A0mid?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cter-processing-functions-and-operators.md | 22 +++++++++++++++++++ ...cter-processing-functions-and-operators.md | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/product/zh/docs-mogdb/v5.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md b/product/zh/docs-mogdb/v5.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md index 290cead8..a357f9d2 100644 --- a/product/zh/docs-mogdb/v5.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md +++ b/product/zh/docs-mogdb/v5.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md @@ -450,6 +450,28 @@ date: 2022-10-24 (1 row) ``` +- mid(str text, pos int, len int) + + 描述:返回str字符串从pos开始,长度为len个字符的子字符串。如果pos为负数,则从末尾开始计算位置。 + + 返回值类型:text + + 示例: + + ```sql + db_m=# select mid('abcdef', 2, 2); + mid + ----- + bc + (1 row) + + db_m=# select mid('abcdef', -2, 2); + mid + ----- + ef + (1 row) + ``` + - field(str, str1,str2,str3,…) 描述:获取str在后面strn中的位置,不区分大小写。 diff --git a/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md b/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md index 2c1d48d3..674bbf8f 100644 --- a/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md +++ b/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-syntax/sql-reference/functions-and-operators/dolphin-character-processing-functions-and-operators.md @@ -471,6 +471,28 @@ date: 2022-10-24 (1 row) ``` +- mid(str text, pos int, len int) + + 描述:返回str字符串从pos开始,长度为len个字符的子字符串。如果pos为负数,则从末尾开始计算位置。 + + 返回值类型:text + + 示例: + + ```sql + db_m=# select mid('abcdef', 2, 2); + mid + ----- + bc + (1 row) + + db_m=# select mid('abcdef', -2, 2); + mid + ----- + ef + (1 row) + ``` + - field(str, str1,str2,str3,…) 描述:获取str在后面strn中的位置。 -- Gitee From 42e4d924e51c7558c53d00f992c7d85ac2ba61e7 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 23 Aug 2024 17:36:34 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix(mogdb):20.3=E6=94=B9=E4=B8=BA20.03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standard-installation/2-environment-requirement.md | 2 +- product/en/docs-mogdb/v2.0/faqs/product-faqs.md | 4 ++-- .../1-installation-preparation.md | 2 +- .../standard-installation/2-environment-requirement.md | 2 +- product/en/docs-mogdb/v2.1/faqs/product-faqs.md | 4 ++-- product/en/docs-mogdb/v3.0/faqs/product-faqs.md | 4 ++-- product/en/docs-mogdb/v3.1/faqs/product-faqs.md | 4 ++-- product/en/docs-mogdb/v5.0/faqs/product-faqs.md | 4 ++-- product/en/docs-mogdb/v5.2/faqs/product-faqs.md | 4 ++-- product/en/docs-mogdb/v6.0/faqs/product-faqs.md | 4 ++-- .../standard-installation/2-environment-requirement.md | 2 +- product/zh/docs-mogdb/v2.0/faqs/product-faqs.md | 4 ++-- .../1-installation-preparation.md | 2 +- .../standard-installation/2-environment-requirement.md | 2 +- product/zh/docs-mogdb/v2.1/faqs/product-faqs.md | 4 ++-- product/zh/docs-mogdb/v3.0/faqs/product-faqs.md | 4 ++-- product/zh/docs-mogdb/v3.1/faqs/product-faqs.md | 4 ++-- product/zh/docs-mogdb/v5.0/faqs/product-faqs.md | 4 ++-- product/zh/docs-mogdb/v5.2/faqs/product-faqs.md | 4 ++-- product/zh/docs-mogdb/v6.0/faqs/product-faqs.md | 4 ++-- 20 files changed, 34 insertions(+), 34 deletions(-) diff --git a/product/en/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md b/product/en/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md index 8831c11d..c9f802b9 100644 --- a/product/en/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md +++ b/product/en/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md @@ -20,7 +20,7 @@ date: 2021-04-2 | Software | Description | | ----------------- | ------------------------------------------------------------ | -| Linux OS | openEuler 20.3LTS and CentOS 7.6 | +| Linux OS | openEuler 20.03LTS and CentOS 7.6 | | Tool | Huawei JDK 1.8.0, psmisc, and bzip2 | | Python | - openEuler: Python 3.7.X is supported.
- CentOS: Python 3.6.X is supported. | diff --git a/product/en/docs-mogdb/v2.0/faqs/product-faqs.md b/product/en/docs-mogdb/v2.0/faqs/product-faqs.md index 4b53bc3d..129d1945 100644 --- a/product/en/docs-mogdb/v2.0/faqs/product-faqs.md +++ b/product/en/docs-mogdb/v2.0/faqs/product-faqs.md @@ -120,10 +120,10 @@ For ecological consideration: MogDB can be deployed on the following OSs: - ARM: - - openEuler 20.3LTS (recommended) + - openEuler 20.03LTS (recommended) - Kylin OS V10 - x86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/en/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md b/product/en/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md index 904fd98b..05ce47a8 100644 --- a/product/en/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md +++ b/product/en/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md @@ -87,7 +87,7 @@ This section describes hardware and software requirements of MogDB. It is recomm | Software | Configuration Description | | :---------------- | :----------------------------------------------------------- | -| Linux OS | ARM:
- openEuler 20.3LTS (recommended)
- Kirin V10
x86:
openEuler 20.3LTS
- CentOS 7.6 | +| Linux OS | ARM:
- openEuler 20.03LTS (recommended)
- Kirin V10
x86:
openEuler 20.03LTS
- CentOS 7.6 | | rdtscp Instruction Set (x86) | Run the `lscpu | grep rdtscp` command to see if the rdtscp instruction set is supported. | | Tool | bzip2 | diff --git a/product/en/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md b/product/en/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md index 48e5759d..2bb83e3c 100644 --- a/product/en/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md +++ b/product/en/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md @@ -22,7 +22,7 @@ The following table describes the minimum hardware requirements of MogDB. When p | Software | Description | | ----------------- | ------------------------------------------------------------ | -| Linux OS | - Arm:
openEuler 20.3LTS / CentOS 7 / Redhat Linux 7 / Kylin OS V10 (Currently not compatible with CentOS 8/Redhat Linux 8 series)
-x86:
openEuler 20.3LTS
CentOS 7.6 | +| Linux OS | - Arm:
openEuler 20.03LTS / CentOS 7 / Redhat Linux 7 / Kylin OS V10 (Currently not compatible with CentOS 8/Redhat Linux 8 series)
-x86:
openEuler 20.03LTS
CentOS 7.6 | | rdtscp Instruction Set (x86) | Run the `lscpu | grep rdtscp` command to see if the rdtscp instruction set is supported. | | Tool | Huawei JDK 1.8.0, psmisc, and bzip2 | | Python | - openEuler: Python 3.7.X is supported.
- CentOS: Python 3.6.X is supported.
- Kirin: Python 3.7.X is supported.
NOTE:
Python needs to be compiled in -enable-shared mode. | diff --git a/product/en/docs-mogdb/v2.1/faqs/product-faqs.md b/product/en/docs-mogdb/v2.1/faqs/product-faqs.md index 2c951e00..294b6eea 100644 --- a/product/en/docs-mogdb/v2.1/faqs/product-faqs.md +++ b/product/en/docs-mogdb/v2.1/faqs/product-faqs.md @@ -120,10 +120,10 @@ For ecological consideration: MogDB can be deployed on the following OSs: - ARM: - - openEuler 20.3LTS (recommended) + - openEuler 20.03LTS (recommended) - Kylin OS V10 - x86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/en/docs-mogdb/v3.0/faqs/product-faqs.md b/product/en/docs-mogdb/v3.0/faqs/product-faqs.md index 22ab7195..0ad9dabb 100644 --- a/product/en/docs-mogdb/v3.0/faqs/product-faqs.md +++ b/product/en/docs-mogdb/v3.0/faqs/product-faqs.md @@ -120,10 +120,10 @@ For ecological consideration: MogDB can be deployed on the following OSs: - ARM: - - openEuler 20.3LTS (recommended) + - openEuler 20.03LTS (recommended) - Kylin OS V10 - x86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/en/docs-mogdb/v3.1/faqs/product-faqs.md b/product/en/docs-mogdb/v3.1/faqs/product-faqs.md index 22ab7195..0ad9dabb 100644 --- a/product/en/docs-mogdb/v3.1/faqs/product-faqs.md +++ b/product/en/docs-mogdb/v3.1/faqs/product-faqs.md @@ -120,10 +120,10 @@ For ecological consideration: MogDB can be deployed on the following OSs: - ARM: - - openEuler 20.3LTS (recommended) + - openEuler 20.03LTS (recommended) - Kylin OS V10 - x86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/en/docs-mogdb/v5.0/faqs/product-faqs.md b/product/en/docs-mogdb/v5.0/faqs/product-faqs.md index bc9a7ce1..8e69d351 100644 --- a/product/en/docs-mogdb/v5.0/faqs/product-faqs.md +++ b/product/en/docs-mogdb/v5.0/faqs/product-faqs.md @@ -120,10 +120,10 @@ For ecological consideration: MogDB can be deployed on the following OSs: - ARM: - - openEuler 20.3LTS (recommended) + - openEuler 20.03LTS (recommended) - Kylin OS V10 - x86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/en/docs-mogdb/v5.2/faqs/product-faqs.md b/product/en/docs-mogdb/v5.2/faqs/product-faqs.md index bc9a7ce1..8e69d351 100644 --- a/product/en/docs-mogdb/v5.2/faqs/product-faqs.md +++ b/product/en/docs-mogdb/v5.2/faqs/product-faqs.md @@ -120,10 +120,10 @@ For ecological consideration: MogDB can be deployed on the following OSs: - ARM: - - openEuler 20.3LTS (recommended) + - openEuler 20.03LTS (recommended) - Kylin OS V10 - x86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/en/docs-mogdb/v6.0/faqs/product-faqs.md b/product/en/docs-mogdb/v6.0/faqs/product-faqs.md index bc9a7ce1..8e69d351 100644 --- a/product/en/docs-mogdb/v6.0/faqs/product-faqs.md +++ b/product/en/docs-mogdb/v6.0/faqs/product-faqs.md @@ -120,10 +120,10 @@ For ecological consideration: MogDB can be deployed on the following OSs: - ARM: - - openEuler 20.3LTS (recommended) + - openEuler 20.03LTS (recommended) - Kylin OS V10 - x86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/zh/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md b/product/zh/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md index 31417075..566aedd8 100644 --- a/product/zh/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md +++ b/product/zh/docs-mogdb/v1.1/installation-guide/standard-installation/2-environment-requirement.md @@ -20,7 +20,7 @@ date: 2021-04-2 | 软件类型 | 配置描述 | | ------------- | ------------------------------------------------------------ | -| Linux操作系统 | openEuler 20.3LTS和CentOS 7.6 | +| Linux操作系统 | openEuler 20.03LTS和CentOS 7.6 | | 工具 | Huawei JDK 1.8.0、psmisc、bzip2 | | Python | - openEuler:支持Python 3.7.X
- CentOS:支持Python 3.6.X | diff --git a/product/zh/docs-mogdb/v2.0/faqs/product-faqs.md b/product/zh/docs-mogdb/v2.0/faqs/product-faqs.md index c4c22281..1aea1d64 100644 --- a/product/zh/docs-mogdb/v2.0/faqs/product-faqs.md +++ b/product/zh/docs-mogdb/v2.0/faqs/product-faqs.md @@ -108,10 +108,10 @@ DBCOMPATIBILITY [ = ] compatibility_type MogDB支持部署在以下操作系统: - ARM: - - openEuler 20.3LTS(推荐采用此操作系统) + - openEuler 20.03LTS(推荐采用此操作系统) - 麒麟V10 - X86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/zh/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md b/product/zh/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md index 2d53e411..5077b173 100644 --- a/product/zh/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md +++ b/product/zh/docs-mogdb/v2.0/installation-guide/simplified-installation-process/1-installation-preparation.md @@ -87,7 +87,7 @@ date: 2021-06-11 | 软件类型 | 配置描述 | | :------------ | :----------------------------------------------------------- | -| Linux操作系统 | ARM:
- openEuler 20.3LTS(推荐采用此操作系统)
- 麒麟V10
X86:
- openEuler 20.3LTS
- CentOS 7.6 | +| Linux操作系统 | ARM:
- openEuler 20.03LTS(推荐采用此操作系统)
- 麒麟V10
X86:
- openEuler 20.03LTS
- CentOS 7.6 | | rdtscp指令集(x86) | 执行`lscpu | grep rdtscp`命令查看是否支持rdtscp指令集。 | | 工具 | bzip2 | diff --git a/product/zh/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md b/product/zh/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md index 7b29ada2..3f2b3b72 100644 --- a/product/zh/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md +++ b/product/zh/docs-mogdb/v2.0/installation-guide/standard-installation/2-environment-requirement.md @@ -22,7 +22,7 @@ date: 2021-04-2 | 软件类型 | 配置描述 | | ------------- | ------------------------------------------------------------ | -| Linux操作系统 | - ARM:
openEuler 20.3LTS / CentOS 7 / Redhat Linux 7 / 麒麟v10(目前不兼容CentOS 8/Redhat Linux 8系列)
- x86:
openEuler 20.3LTS
CentOS 7.6 | +| Linux操作系统 | - ARM:
openEuler 20.03LTS / CentOS 7 / Redhat Linux 7 / 麒麟v10(目前不兼容CentOS 8/Redhat Linux 8系列)
- x86:
openEuler 20.03LTS
CentOS 7.6 | | rdtscp指令集(x86) | 执行`lscpu | grep rdtscp`命令查看是否支持rdtscp指令集。 | | 工具 | Huawei JDK 1.8.0、psmisc、bzip2 | | Python | - openEuler:支持Python 3.7.X
- CentOS:支持Python 3.6.X
- 麒麟:支持Python 3.7.X
说明:
python需要通过-enable-shared方式编译。 | diff --git a/product/zh/docs-mogdb/v2.1/faqs/product-faqs.md b/product/zh/docs-mogdb/v2.1/faqs/product-faqs.md index 3739849b..a55d3847 100644 --- a/product/zh/docs-mogdb/v2.1/faqs/product-faqs.md +++ b/product/zh/docs-mogdb/v2.1/faqs/product-faqs.md @@ -108,10 +108,10 @@ DBCOMPATIBILITY [ = ] compatibility_type MogDB支持部署在以下操作系统: - ARM: - - openEuler 20.3LTS(推荐采用此操作系统) + - openEuler 20.03LTS(推荐采用此操作系统) - 麒麟V10 - X86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/zh/docs-mogdb/v3.0/faqs/product-faqs.md b/product/zh/docs-mogdb/v3.0/faqs/product-faqs.md index 8acf8068..885615a2 100644 --- a/product/zh/docs-mogdb/v3.0/faqs/product-faqs.md +++ b/product/zh/docs-mogdb/v3.0/faqs/product-faqs.md @@ -108,10 +108,10 @@ DBCOMPATIBILITY [ = ] compatibility_type MogDB支持部署在以下操作系统: - ARM: - - openEuler 20.3LTS(推荐采用此操作系统) + - openEuler 20.03LTS(推荐采用此操作系统) - 麒麟V10 - X86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/zh/docs-mogdb/v3.1/faqs/product-faqs.md b/product/zh/docs-mogdb/v3.1/faqs/product-faqs.md index 8acf8068..885615a2 100644 --- a/product/zh/docs-mogdb/v3.1/faqs/product-faqs.md +++ b/product/zh/docs-mogdb/v3.1/faqs/product-faqs.md @@ -108,10 +108,10 @@ DBCOMPATIBILITY [ = ] compatibility_type MogDB支持部署在以下操作系统: - ARM: - - openEuler 20.3LTS(推荐采用此操作系统) + - openEuler 20.03LTS(推荐采用此操作系统) - 麒麟V10 - X86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/zh/docs-mogdb/v5.0/faqs/product-faqs.md b/product/zh/docs-mogdb/v5.0/faqs/product-faqs.md index 8acf8068..885615a2 100644 --- a/product/zh/docs-mogdb/v5.0/faqs/product-faqs.md +++ b/product/zh/docs-mogdb/v5.0/faqs/product-faqs.md @@ -108,10 +108,10 @@ DBCOMPATIBILITY [ = ] compatibility_type MogDB支持部署在以下操作系统: - ARM: - - openEuler 20.3LTS(推荐采用此操作系统) + - openEuler 20.03LTS(推荐采用此操作系统) - 麒麟V10 - X86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/zh/docs-mogdb/v5.2/faqs/product-faqs.md b/product/zh/docs-mogdb/v5.2/faqs/product-faqs.md index 8acf8068..885615a2 100644 --- a/product/zh/docs-mogdb/v5.2/faqs/product-faqs.md +++ b/product/zh/docs-mogdb/v5.2/faqs/product-faqs.md @@ -108,10 +108,10 @@ DBCOMPATIBILITY [ = ] compatibility_type MogDB支持部署在以下操作系统: - ARM: - - openEuler 20.3LTS(推荐采用此操作系统) + - openEuler 20.03LTS(推荐采用此操作系统) - 麒麟V10 - X86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 diff --git a/product/zh/docs-mogdb/v6.0/faqs/product-faqs.md b/product/zh/docs-mogdb/v6.0/faqs/product-faqs.md index 64ab60d1..5084b75e 100644 --- a/product/zh/docs-mogdb/v6.0/faqs/product-faqs.md +++ b/product/zh/docs-mogdb/v6.0/faqs/product-faqs.md @@ -108,10 +108,10 @@ DBCOMPATIBILITY [ = ] compatibility_type MogDB支持部署在以下操作系统: - ARM: - - openEuler 20.3LTS(推荐采用此操作系统) + - openEuler 20.03LTS(推荐采用此操作系统) - 麒麟V10 - X86: - - openEuler 20.3LTS + - openEuler 20.03LTS - CentOS 7.6 - Asianux 7.6 -- Gitee From a4ae3a2ced4d86630a709f26f0ed150bde46680b Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 23 Aug 2024 17:39:29 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix(mogdb):=E6=B7=BB=E5=8A=A0upgrade=5Fmode?= =?UTF-8?q?=E5=AF=B9dolphin=E7=9A=84=E7=BA=A6=E6=9D=9F=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dolphin-extension/dolphin-restrictions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-restrictions.md b/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-restrictions.md index 5ccdb901..73a434e0 100644 --- a/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-restrictions.md +++ b/product/zh/docs-mogdb/v6.0/developer-guide/mysql-compatibility-description/dolphin-extension/dolphin-restrictions.md @@ -15,4 +15,5 @@ date: 2022-10-24 - dolphin插件依赖于public schema,因此不支持使用drop schema的方式删除public schema。 - 连接安装有dolphin插件的B兼容性数据库时,会默认修改GUC参数[behavior_compat_options](../../../reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md#behavior_compat_options),增加`display_leading_zero`和`select_into_return_null`选项,以保持兼容性。 - 连接安装有dolphin插件的B兼容性数据库时,会默认修改GUC参数[datestyle](../../../reference-guide/guc-parameters/default-settings-of-client-connection/zone-and-formatting.md#datestyle)为`ISO, YMD`,以保持兼容性。手动修改该参数可能会导致日期格式产生歧义。 -- dolphin插件依赖dblink插件,会在加载dolphin插件之前,自动加载dblink。 \ No newline at end of file +- dolphin插件依赖dblink插件,会在加载dolphin插件之前,自动加载dblink。 +- 设置upgrade_mode为非0时,创建B兼容性数据库后不会自动创建dolphin插件。该限制主要是控制升级过程中不允许创建插件,避免回滚的时候无法删除。 \ No newline at end of file -- Gitee From b97718e87a5a835669312f129e63e0db5204657f Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Mon, 26 Aug 2024 10:43:48 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix(mogdb):enable=5Fmultitable=5Fupdate?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform-and-client-compatibility.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md b/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md index a18126b8..5992b9b2 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md @@ -601,13 +601,13 @@ date: 2021-04-20 ## enable_multitable_update -**参数说明**:控制在A模式中是否支持多表查询操作。 +**参数说明**:MogDB默认只在B模式下支持多表更新操作,打开此参数支持在A模式下使用多表更新功能。 该参数属于USERSET类型参数,请参考表[GUC参数分类](../../../reference-guide/guc-parameters/appendix.md)中对应设置方法进行设置。 **取值范围**:布尔类型 -- on表示支持多表查询操作 -- off表示不支持多表查询操作 +- on表示支持在A模式下使用多表更新功能 +- off表示不支持在A模式下使用多表更新功能 **默认值**:off \ No newline at end of file -- Gitee From bd9b47ee3c3bcec2b1122be97edaa0374a7b5c63 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Tue, 27 Aug 2024 16:20:19 +0800 Subject: [PATCH 5/5] fix(mogdb):fix some issues --- .../2-sql/1-query-execution-process.md | 2 +- .../2-sql/1-query-execution-process.md | 2 +- .../2-sql/1-query-execution-process.md | 2 +- .../2-sql/1-query-execution-process.md | 2 +- ...-introduction-to-the-sql-execution-plan.md | 2 +- .../2-sql/1-query-execution-process.md | 2 +- ...-introduction-to-the-sql-execution-plan.md | 2 +- .../introduction-to-the-sql-execution-plan.md | 2 +- .../sql-tuning/query-execution-process.md | 2 +- .../sql-tuning/sql-tuning-optimizer.md | 30 ------------------- .../sql-tuning/sql-tuning.md | 1 - product/zh/docs-mogdb/v5.0/toc.md | 1 - product/zh/docs-mogdb/v5.0/toc_performance.md | 1 - .../introduction-to-the-sql-execution-plan.md | 2 +- .../sql-tuning/query-execution-process.md | 2 +- .../sql-tuning/sql-tuning-optimizer.md | 30 ------------------- .../sql-tuning/sql-tuning.md | 1 - product/zh/docs-mogdb/v5.2/toc.md | 1 - product/zh/docs-mogdb/v5.2/toc_performance.md | 1 - .../introduction-to-the-sql-execution-plan.md | 2 +- .../sql-tuning/query-execution-process.md | 2 +- .../sql-tuning/sql-tuning-optimizer.md | 30 ------------------- .../sql-tuning/sql-tuning.md | 1 - product/zh/docs-mogdb/v6.0/toc.md | 1 - product/zh/docs-mogdb/v6.0/toc_performance.md | 1 - 25 files changed, 13 insertions(+), 112 deletions(-) delete mode 100644 product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md delete mode 100644 product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning-optimizer.md delete mode 100644 product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md diff --git a/product/zh/docs-mogdb/v1.1/performance-tuning/2-sql/1-query-execution-process.md b/product/zh/docs-mogdb/v1.1/performance-tuning/2-sql/1-query-execution-process.md index 7a4766ac..233bc431 100644 --- a/product/zh/docs-mogdb/v1.1/performance-tuning/2-sql/1-query-execution-process.md +++ b/product/zh/docs-mogdb/v1.1/performance-tuning/2-sql/1-query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v2.0/performance-tuning/2-sql/1-query-execution-process.md b/product/zh/docs-mogdb/v2.0/performance-tuning/2-sql/1-query-execution-process.md index 7a4766ac..233bc431 100644 --- a/product/zh/docs-mogdb/v2.0/performance-tuning/2-sql/1-query-execution-process.md +++ b/product/zh/docs-mogdb/v2.0/performance-tuning/2-sql/1-query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v2.1/performance-tuning/2-sql/1-query-execution-process.md b/product/zh/docs-mogdb/v2.1/performance-tuning/2-sql/1-query-execution-process.md index 00e0132e..e5165391 100644 --- a/product/zh/docs-mogdb/v2.1/performance-tuning/2-sql/1-query-execution-process.md +++ b/product/zh/docs-mogdb/v2.1/performance-tuning/2-sql/1-query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/1-query-execution-process.md b/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/1-query-execution-process.md index 00e0132e..e5165391 100644 --- a/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/1-query-execution-process.md +++ b/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/1-query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md b/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md index b0473851..4d83428d 100644 --- a/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md +++ b/product/zh/docs-mogdb/v3.0/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md @@ -11,7 +11,7 @@ date: 2021-03-04 ## SQL执行计划概述 -SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时执行的详细步骤。每一个步骤为一个数据库运算符。 +SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时的详细步骤。每一个步骤为一个数据库运算符。 使用EXPLAIN命令可以查看优化器为每个查询生成的具体执行计划。EXPLAIN给每个执行节点都输出一行,显示基本的节点类型和优化器为执行这个节点预计的开销值。如图1所示。 diff --git a/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/1-query-execution-process.md b/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/1-query-execution-process.md index 00e0132e..e5165391 100644 --- a/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/1-query-execution-process.md +++ b/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/1-query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md b/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md index b0473851..4d83428d 100644 --- a/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md +++ b/product/zh/docs-mogdb/v3.1/performance-tuning/2-sql/2-introduction-to-the-sql-execution-plan.md @@ -11,7 +11,7 @@ date: 2021-03-04 ## SQL执行计划概述 -SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时执行的详细步骤。每一个步骤为一个数据库运算符。 +SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时的详细步骤。每一个步骤为一个数据库运算符。 使用EXPLAIN命令可以查看优化器为每个查询生成的具体执行计划。EXPLAIN给每个执行节点都输出一行,显示基本的节点类型和优化器为执行这个节点预计的开销值。如图1所示。 diff --git a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md index b2b934d4..fb758225 100644 --- a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md +++ b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md @@ -11,7 +11,7 @@ date: 2021-03-04 ## SQL执行计划概述 -SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时执行的详细步骤。每一个步骤为一个数据库运算符。 +SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时的详细步骤。每一个步骤为一个数据库运算符。 使用EXPLAIN命令可以查看优化器为每个查询生成的具体执行计划。EXPLAIN给每个执行节点都输出一行,显示基本的节点类型和优化器为执行这个节点预计的开销值。如图1所示。 diff --git a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/query-execution-process.md b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/query-execution-process.md index 00e0132e..e5165391 100644 --- a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/query-execution-process.md +++ b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md deleted file mode 100644 index b33debd9..00000000 --- a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 优化器 -summary: 优化器 -author: zhang cuiping -date: 2023-04-07 ---- - -# 优化器 - -优化器(optimizer)的任务是创建一个优化了执行规划。 一个特定的 SQL 查询(因此也就是一个查询树)实际上可以以多种不同的方式执行, 每种都生成相同的结果集。如果可能,查询优化器将检查每个可能的执行规划, 最终选择认为运行最快的执行计划。 - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif)**说明:** 有些情况下,检查一个查询所有可能的执行方式会花去很多时间和内存空间。 特别是在正在执行的查询涉及大量连接操作的时候。 为了在合理的时间里判断一个合理的(而不是优化的)查询计划。 - -优化器的搜索过程实际上是与叫做*paths*的数据结构一起结合运转的, 这个数据结构是一个很简单的规划的精简版本,它只包括优化器用来决策所必须的信息。 在找到最经济的路径之后,就制作一个完整的规划树(*plan tree*)传递给执行器。 它有足够的详细信息,代表着需要执行的计划,执行器可以读懂并运行之。 在本章剩余部分,将忽略路径和规划之间的区别。 - -## 生成可能的规划 - -优化器通过为扫描查询里出现的每个关系(表)生成规划, 可能的规划是由每个关系上有哪些可用的索引决定的。 对一个关系总是可以进行一次顺序查找,所以总是会创建只使用顺序查找的规划。 假设一个关系上定义着一个索引(例如 B-tree 索引), 并且一条查询包含约束`relation.attribute OPR constant`。 如果`relation.attribute`碰巧匹配 B-tree 索引的关键字 并且`OPR`又是列出在索引的操作符类中的操作符中的一个, 那么将会创建另一个使用 B-tree 索引扫描该关系的规划。 如果还有别的索引,而且查询里面的约束又和那个索引的关键字匹配,则还会生成更多的规划。 - -如果查询要求链接两个或两个以上的关系,在扫描单一的关系时,所有可行的计划被找到后,链接关系的计划才会被考虑。有三种可能的连接策略: - -- 嵌套循环连接(*nested loop join*): 对左边的关系里面找到的每条行都对右边关系进行一次扫描。 这个策略容易实现,但是可能会很耗费时间。 但是,如果右边的关系可以用索引扫描,那么这个可能就是个好策略。 可以用来自左边关系的当前行的数值为键字进行对右边关系的索引扫描。 -- 融合排序连接(*merge join*): 在连接开始之前,每个关系都对连接字段进行排序。 然后对两个关系并发扫描,匹配的行就组合起来形成连接行。 这种联合更有吸引力,因为每个关系都只用扫描一次。 要求的排序步骤可以通过明确的排序步骤, 或者是使用连接键字上的索引按照恰当的顺序扫描关系。 -- Hash 连接*hash join*: 首先扫描右边的关系,并用连接的字段作为散列键字加载进入一个 Hash 表, 然后扫描左边的关系,并将找到的每行用作散列键字来以定位表里匹配的行。 - -如果查询里的关系多于两个,最后的结果必须通过一个连接步骤树建立,每个步骤有两个输入。 优化器检查不同的连接顺序可能,找出开销最小的。 - -如果查询使用了比geqo_threshold少的关系,为了找到最好的接入序列,near-exhaustive查找被运行。 策划者优先考虑接入任意两个关系之间,那些在`WHERE`qualification里存在一个相应的加入条款(例如: 存在像`where rel1.attr1=rel2.attr2`这样的关系)。只有在没有别的选择的时候考虑加入对时没有join字句, 也就是,一个特别的关系对另外的关系没有可用的join子句。策划者会为每一个加入对想到所有可能的计划,选择计划的标准之一是(估计是)选择最便宜的。 - -完成的查询树由对基础关系的顺序或者索引扫描组成, 并根据需要加上嵌套循环、融合、以及 Hash 连接节点,加上任何需要的辅助步骤, 比如排序节点或者聚集函数计算节点等。 大多数这些规划节点类型都有额外的做选择(*selection*) (抛弃那些不符合指定布尔条件的行)和投影(*projection*) (基于给出的字段数值计算一个派生出的字段集,也就是在需要时计算标量表达式)。 优化器的一个责任是从`WHERE`子句中 附加选择条件以及为规划树最合适的节点计算所需要的输出表达式。 \ No newline at end of file diff --git a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning.md b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning.md index 6b8da183..0336d590 100644 --- a/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning.md +++ b/product/zh/docs-mogdb/v5.0/performance-tuning/sql-tuning/sql-tuning.md @@ -7,7 +7,6 @@ date: 2023-04-07 # SQL优化指南 -- **[优化器](sql-tuning-optimizer.md)** - **[Query执行流程](query-execution-process.md)** - **[SQL执行计划介绍](introduction-to-the-sql-execution-plan.md)** - **[调优流程](tuning-process.md)** diff --git a/product/zh/docs-mogdb/v5.0/toc.md b/product/zh/docs-mogdb/v5.0/toc.md index 5bd7a78f..64a760c1 100644 --- a/product/zh/docs-mogdb/v5.0/toc.md +++ b/product/zh/docs-mogdb/v5.0/toc.md @@ -734,7 +734,6 @@ + [设置控制组](./performance-tuning/system-tuning/resource-load-management/resource-management-preparations/setting-control-group.md) + [创建资源池](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/creating-resource-pool.md) + [SQL优化指南](/performance-tuning/sql-tuning/sql-tuning.md) - + [优化器]( ./performance-tuning/sql-tuning/sql-tuning-optimizer.md) + [Query执行流程](/performance-tuning/sql-tuning/query-execution-process.md) + [SQL执行计划介绍](/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md) + [调优流程](/performance-tuning/sql-tuning/tuning-process.md) diff --git a/product/zh/docs-mogdb/v5.0/toc_performance.md b/product/zh/docs-mogdb/v5.0/toc_performance.md index 8ac52080..24c0d55b 100644 --- a/product/zh/docs-mogdb/v5.0/toc_performance.md +++ b/product/zh/docs-mogdb/v5.0/toc_performance.md @@ -18,7 +18,6 @@ + [设置控制组](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/setting-control-group.md) + [创建资源池](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/creating-resource-pool.md) + [SQL优化指南](/performance-tuning/sql-tuning/sql-tuning.md) - + [优化器]( ./performance-tuning/sql-tuning/sql-tuning-optimizer.md) + [Query执行流程](/performance-tuning/sql-tuning/query-execution-process.md) + [SQL执行计划介绍](/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md) + [调优流程](/performance-tuning/sql-tuning/tuning-process.md) diff --git a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md b/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md index b2b934d4..fb758225 100644 --- a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md +++ b/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md @@ -11,7 +11,7 @@ date: 2021-03-04 ## SQL执行计划概述 -SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时执行的详细步骤。每一个步骤为一个数据库运算符。 +SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时的详细步骤。每一个步骤为一个数据库运算符。 使用EXPLAIN命令可以查看优化器为每个查询生成的具体执行计划。EXPLAIN给每个执行节点都输出一行,显示基本的节点类型和优化器为执行这个节点预计的开销值。如图1所示。 diff --git a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/query-execution-process.md b/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/query-execution-process.md index 00e0132e..e5165391 100644 --- a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/query-execution-process.md +++ b/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning-optimizer.md b/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning-optimizer.md deleted file mode 100644 index b33debd9..00000000 --- a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning-optimizer.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 优化器 -summary: 优化器 -author: zhang cuiping -date: 2023-04-07 ---- - -# 优化器 - -优化器(optimizer)的任务是创建一个优化了执行规划。 一个特定的 SQL 查询(因此也就是一个查询树)实际上可以以多种不同的方式执行, 每种都生成相同的结果集。如果可能,查询优化器将检查每个可能的执行规划, 最终选择认为运行最快的执行计划。 - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif)**说明:** 有些情况下,检查一个查询所有可能的执行方式会花去很多时间和内存空间。 特别是在正在执行的查询涉及大量连接操作的时候。 为了在合理的时间里判断一个合理的(而不是优化的)查询计划。 - -优化器的搜索过程实际上是与叫做*paths*的数据结构一起结合运转的, 这个数据结构是一个很简单的规划的精简版本,它只包括优化器用来决策所必须的信息。 在找到最经济的路径之后,就制作一个完整的规划树(*plan tree*)传递给执行器。 它有足够的详细信息,代表着需要执行的计划,执行器可以读懂并运行之。 在本章剩余部分,将忽略路径和规划之间的区别。 - -## 生成可能的规划 - -优化器通过为扫描查询里出现的每个关系(表)生成规划, 可能的规划是由每个关系上有哪些可用的索引决定的。 对一个关系总是可以进行一次顺序查找,所以总是会创建只使用顺序查找的规划。 假设一个关系上定义着一个索引(例如 B-tree 索引), 并且一条查询包含约束`relation.attribute OPR constant`。 如果`relation.attribute`碰巧匹配 B-tree 索引的关键字 并且`OPR`又是列出在索引的操作符类中的操作符中的一个, 那么将会创建另一个使用 B-tree 索引扫描该关系的规划。 如果还有别的索引,而且查询里面的约束又和那个索引的关键字匹配,则还会生成更多的规划。 - -如果查询要求链接两个或两个以上的关系,在扫描单一的关系时,所有可行的计划被找到后,链接关系的计划才会被考虑。有三种可能的连接策略: - -- 嵌套循环连接(*nested loop join*): 对左边的关系里面找到的每条行都对右边关系进行一次扫描。 这个策略容易实现,但是可能会很耗费时间。 但是,如果右边的关系可以用索引扫描,那么这个可能就是个好策略。 可以用来自左边关系的当前行的数值为键字进行对右边关系的索引扫描。 -- 融合排序连接(*merge join*): 在连接开始之前,每个关系都对连接字段进行排序。 然后对两个关系并发扫描,匹配的行就组合起来形成连接行。 这种联合更有吸引力,因为每个关系都只用扫描一次。 要求的排序步骤可以通过明确的排序步骤, 或者是使用连接键字上的索引按照恰当的顺序扫描关系。 -- Hash 连接*hash join*: 首先扫描右边的关系,并用连接的字段作为散列键字加载进入一个 Hash 表, 然后扫描左边的关系,并将找到的每行用作散列键字来以定位表里匹配的行。 - -如果查询里的关系多于两个,最后的结果必须通过一个连接步骤树建立,每个步骤有两个输入。 优化器检查不同的连接顺序可能,找出开销最小的。 - -如果查询使用了比geqo_threshold少的关系,为了找到最好的接入序列,near-exhaustive查找被运行。 策划者优先考虑接入任意两个关系之间,那些在`WHERE`qualification里存在一个相应的加入条款(例如: 存在像`where rel1.attr1=rel2.attr2`这样的关系)。只有在没有别的选择的时候考虑加入对时没有join字句, 也就是,一个特别的关系对另外的关系没有可用的join子句。策划者会为每一个加入对想到所有可能的计划,选择计划的标准之一是(估计是)选择最便宜的。 - -完成的查询树由对基础关系的顺序或者索引扫描组成, 并根据需要加上嵌套循环、融合、以及 Hash 连接节点,加上任何需要的辅助步骤, 比如排序节点或者聚集函数计算节点等。 大多数这些规划节点类型都有额外的做选择(*selection*) (抛弃那些不符合指定布尔条件的行)和投影(*projection*) (基于给出的字段数值计算一个派生出的字段集,也就是在需要时计算标量表达式)。 优化器的一个责任是从`WHERE`子句中 附加选择条件以及为规划树最合适的节点计算所需要的输出表达式。 \ No newline at end of file diff --git a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning.md b/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning.md index 6b8da183..0336d590 100644 --- a/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning.md +++ b/product/zh/docs-mogdb/v5.2/performance-tuning/sql-tuning/sql-tuning.md @@ -7,7 +7,6 @@ date: 2023-04-07 # SQL优化指南 -- **[优化器](sql-tuning-optimizer.md)** - **[Query执行流程](query-execution-process.md)** - **[SQL执行计划介绍](introduction-to-the-sql-execution-plan.md)** - **[调优流程](tuning-process.md)** diff --git a/product/zh/docs-mogdb/v5.2/toc.md b/product/zh/docs-mogdb/v5.2/toc.md index bb220c1d..9ed8a804 100644 --- a/product/zh/docs-mogdb/v5.2/toc.md +++ b/product/zh/docs-mogdb/v5.2/toc.md @@ -747,7 +747,6 @@ + [设置控制组](./performance-tuning/system-tuning/resource-load-management/resource-management-preparations/setting-control-group.md) + [创建资源池](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/creating-resource-pool.md) + [SQL优化指南](/performance-tuning/sql-tuning/sql-tuning.md) - + [优化器]( ./performance-tuning/sql-tuning/sql-tuning-optimizer.md) + [Query执行流程](/performance-tuning/sql-tuning/query-execution-process.md) + [SQL执行计划介绍](/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md) + [调优流程](/performance-tuning/sql-tuning/tuning-process.md) diff --git a/product/zh/docs-mogdb/v5.2/toc_performance.md b/product/zh/docs-mogdb/v5.2/toc_performance.md index 9a9cb2e3..e5f655af 100644 --- a/product/zh/docs-mogdb/v5.2/toc_performance.md +++ b/product/zh/docs-mogdb/v5.2/toc_performance.md @@ -18,7 +18,6 @@ + [设置控制组](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/setting-control-group.md) + [创建资源池](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/creating-resource-pool.md) + [SQL优化指南](/performance-tuning/sql-tuning/sql-tuning.md) - + [优化器]( ./performance-tuning/sql-tuning/sql-tuning-optimizer.md) + [Query执行流程](/performance-tuning/sql-tuning/query-execution-process.md) + [SQL执行计划介绍](/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md) + [调优流程](/performance-tuning/sql-tuning/tuning-process.md) diff --git a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md index b2b934d4..fb758225 100644 --- a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md +++ b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md @@ -11,7 +11,7 @@ date: 2021-03-04 ## SQL执行计划概述 -SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时执行的详细步骤。每一个步骤为一个数据库运算符。 +SQL执行计划是一个节点树,显示MogDB执行一条SQL语句时的详细步骤。每一个步骤为一个数据库运算符。 使用EXPLAIN命令可以查看优化器为每个查询生成的具体执行计划。EXPLAIN给每个执行节点都输出一行,显示基本的节点类型和优化器为执行这个节点预计的开销值。如图1所示。 diff --git a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/query-execution-process.md b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/query-execution-process.md index 00e0132e..e5165391 100644 --- a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/query-execution-process.md +++ b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/query-execution-process.md @@ -74,6 +74,6 @@ MogDB的表支持行存表、列存表,底层存储方式的选择严格依赖 ## 调优手段之SQL重写 -除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 +除了上述干预SQL引擎所生成执行计划的执行性能外,根据数据库的SQL执行机制以及大量的实践发现,有些场景下,在保证客户业务SQL逻辑等价(或不变)的前提下,通过一定规则由DBA重写SQL语句,可以大幅度的提升SQL语句的性能。 这种调优场景对DBA的要求比较高,需要对客户业务有足够的了解,同时也需要扎实的SQL语句基本功,后续会介绍几个常见的SQL改写场景。 diff --git a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md deleted file mode 100644 index b33debd9..00000000 --- a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning-optimizer.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 优化器 -summary: 优化器 -author: zhang cuiping -date: 2023-04-07 ---- - -# 优化器 - -优化器(optimizer)的任务是创建一个优化了执行规划。 一个特定的 SQL 查询(因此也就是一个查询树)实际上可以以多种不同的方式执行, 每种都生成相同的结果集。如果可能,查询优化器将检查每个可能的执行规划, 最终选择认为运行最快的执行计划。 - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif)**说明:** 有些情况下,检查一个查询所有可能的执行方式会花去很多时间和内存空间。 特别是在正在执行的查询涉及大量连接操作的时候。 为了在合理的时间里判断一个合理的(而不是优化的)查询计划。 - -优化器的搜索过程实际上是与叫做*paths*的数据结构一起结合运转的, 这个数据结构是一个很简单的规划的精简版本,它只包括优化器用来决策所必须的信息。 在找到最经济的路径之后,就制作一个完整的规划树(*plan tree*)传递给执行器。 它有足够的详细信息,代表着需要执行的计划,执行器可以读懂并运行之。 在本章剩余部分,将忽略路径和规划之间的区别。 - -## 生成可能的规划 - -优化器通过为扫描查询里出现的每个关系(表)生成规划, 可能的规划是由每个关系上有哪些可用的索引决定的。 对一个关系总是可以进行一次顺序查找,所以总是会创建只使用顺序查找的规划。 假设一个关系上定义着一个索引(例如 B-tree 索引), 并且一条查询包含约束`relation.attribute OPR constant`。 如果`relation.attribute`碰巧匹配 B-tree 索引的关键字 并且`OPR`又是列出在索引的操作符类中的操作符中的一个, 那么将会创建另一个使用 B-tree 索引扫描该关系的规划。 如果还有别的索引,而且查询里面的约束又和那个索引的关键字匹配,则还会生成更多的规划。 - -如果查询要求链接两个或两个以上的关系,在扫描单一的关系时,所有可行的计划被找到后,链接关系的计划才会被考虑。有三种可能的连接策略: - -- 嵌套循环连接(*nested loop join*): 对左边的关系里面找到的每条行都对右边关系进行一次扫描。 这个策略容易实现,但是可能会很耗费时间。 但是,如果右边的关系可以用索引扫描,那么这个可能就是个好策略。 可以用来自左边关系的当前行的数值为键字进行对右边关系的索引扫描。 -- 融合排序连接(*merge join*): 在连接开始之前,每个关系都对连接字段进行排序。 然后对两个关系并发扫描,匹配的行就组合起来形成连接行。 这种联合更有吸引力,因为每个关系都只用扫描一次。 要求的排序步骤可以通过明确的排序步骤, 或者是使用连接键字上的索引按照恰当的顺序扫描关系。 -- Hash 连接*hash join*: 首先扫描右边的关系,并用连接的字段作为散列键字加载进入一个 Hash 表, 然后扫描左边的关系,并将找到的每行用作散列键字来以定位表里匹配的行。 - -如果查询里的关系多于两个,最后的结果必须通过一个连接步骤树建立,每个步骤有两个输入。 优化器检查不同的连接顺序可能,找出开销最小的。 - -如果查询使用了比geqo_threshold少的关系,为了找到最好的接入序列,near-exhaustive查找被运行。 策划者优先考虑接入任意两个关系之间,那些在`WHERE`qualification里存在一个相应的加入条款(例如: 存在像`where rel1.attr1=rel2.attr2`这样的关系)。只有在没有别的选择的时候考虑加入对时没有join字句, 也就是,一个特别的关系对另外的关系没有可用的join子句。策划者会为每一个加入对想到所有可能的计划,选择计划的标准之一是(估计是)选择最便宜的。 - -完成的查询树由对基础关系的顺序或者索引扫描组成, 并根据需要加上嵌套循环、融合、以及 Hash 连接节点,加上任何需要的辅助步骤, 比如排序节点或者聚集函数计算节点等。 大多数这些规划节点类型都有额外的做选择(*selection*) (抛弃那些不符合指定布尔条件的行)和投影(*projection*) (基于给出的字段数值计算一个派生出的字段集,也就是在需要时计算标量表达式)。 优化器的一个责任是从`WHERE`子句中 附加选择条件以及为规划树最合适的节点计算所需要的输出表达式。 \ No newline at end of file diff --git a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning.md b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning.md index 6b8da183..0336d590 100644 --- a/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning.md +++ b/product/zh/docs-mogdb/v6.0/performance-tuning/sql-tuning/sql-tuning.md @@ -7,7 +7,6 @@ date: 2023-04-07 # SQL优化指南 -- **[优化器](sql-tuning-optimizer.md)** - **[Query执行流程](query-execution-process.md)** - **[SQL执行计划介绍](introduction-to-the-sql-execution-plan.md)** - **[调优流程](tuning-process.md)** diff --git a/product/zh/docs-mogdb/v6.0/toc.md b/product/zh/docs-mogdb/v6.0/toc.md index 95dfc8cf..893ea5de 100644 --- a/product/zh/docs-mogdb/v6.0/toc.md +++ b/product/zh/docs-mogdb/v6.0/toc.md @@ -799,7 +799,6 @@ + [设置控制组](./performance-tuning/system-tuning/resource-load-management/resource-management-preparations/setting-control-group.md) + [创建资源池](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/creating-resource-pool.md) + [SQL优化指南](/performance-tuning/sql-tuning/sql-tuning.md) - + [优化器]( ./performance-tuning/sql-tuning/sql-tuning-optimizer.md) + [Query执行流程](/performance-tuning/sql-tuning/query-execution-process.md) + [SQL执行计划介绍](/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md) + [调优流程](/performance-tuning/sql-tuning/tuning-process.md) diff --git a/product/zh/docs-mogdb/v6.0/toc_performance.md b/product/zh/docs-mogdb/v6.0/toc_performance.md index 44e3f519..c4f45659 100644 --- a/product/zh/docs-mogdb/v6.0/toc_performance.md +++ b/product/zh/docs-mogdb/v6.0/toc_performance.md @@ -21,7 +21,6 @@ + [设置控制组](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/setting-control-group.md) + [创建资源池](/performance-tuning/system-tuning/resource-load-management/resource-management-preparations/creating-resource-pool.md) + [SQL优化指南](/performance-tuning/sql-tuning/sql-tuning.md) - + [优化器]( ./performance-tuning/sql-tuning/sql-tuning-optimizer.md) + [Query执行流程](/performance-tuning/sql-tuning/query-execution-process.md) + [SQL执行计划介绍](/performance-tuning/sql-tuning/introduction-to-the-sql-execution-plan.md) + [调优流程](/performance-tuning/sql-tuning/tuning-process.md) -- Gitee