This is an automated email from the ASF dual-hosted git repository.
djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry-site.git
The following commit(s) were added to refs/heads/main by this push:
new e3a59740 docs: add a step in AQUMV doc and move doc dir
e3a59740 is described below
commit e3a59740d1031b2208d35d95ff3a8a630cce594b
Author: TomShawn <[email protected]>
AuthorDate: Mon Nov 25 11:19:03 2024 +0800
docs: add a step in AQUMV doc and move doc dir
---
...use-auto-materialized-view-to-answer-queries.md | 18 ++++++++++++------
.../parallel-create-ao-refresh-mv.md | 4 ++--
.../{ => performance}/parallel-query-execution.md | 0
.../update-stats-using-analyze.md | 0
.../use-aggre-pushdown-to-speed-up-queries.md | 0
...use-auto-materialized-view-to-answer-queries.md | 22 ++++++++++++++--------
.../use-incremental-materialized-view.md | 4 ++--
.../use-index-scan-on-ao-tables.md | 0
.../use-runtimefilter-to-optimize-queries.md | 0
.../use-unique-index-on-ao-tables.md | 0
10 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/docs/performance/use-auto-materialized-view-to-answer-queries.md
b/docs/performance/use-auto-materialized-view-to-answer-queries.md
index d1c5c1b8..0348db2b 100644
--- a/docs/performance/use-auto-materialized-view-to-answer-queries.md
+++ b/docs/performance/use-auto-materialized-view-to-answer-queries.md
@@ -16,20 +16,26 @@ Since v1.5.0, Cloudberry Database supports automatically
using materialized view
To enable AQUMV, you need to create a materialized view and set the value of
the system parameter `enable_answer_query_using_materialized_views` to `ON`.
The following example compares the results of the same complex query without
AQUMV and with AQUMV.
-1. Create a table `aqumv_t1`.
+1. Turn off the GPORCA planner to use the Postgres-based planner.
+
+ ```sql
+ SET optimizer TO off;
+ ```
+
+2. Create a table `aqumv_t1`.
```sql
CREATE TABLE aqumv_t1(c1 INT, c2 INT, c3 INT) DISTRIBUTED BY (c1);
```
-2. Insert data into the table and collect statistics from the table.
+3. Insert data into the table and collect statistics from the table.
```sql
INSERT INTO aqumv_t1 SELECT i, i+1, i+2 FROM generate_series(1, 100000000)
i;
ANALYZE aqumv_t1;
```
-3. Execute a query without enabling AQUMV. The query takes 7384.329 ms.
+4. Execute a query without enabling AQUMV. The query takes 7384.329 ms.
```sql
SELECT SQRT(ABS(ABS(c2) - c1 - 1) + ABS(c2)) FROM aqumv_t1 WHERE c1 > 30
AND c1 < 40 AND SQRT(ABS(c2)) > 5.8;
@@ -57,7 +63,7 @@ To enable AQUMV, you need to create a materialized view and
set the value of the
(4 rows)
```
-4. Create a materialized view `mvt1` based on `aqumv_t1` and collect
statistics on the view.
+5. Create a materialized view `mvt1` based on `aqumv_t1` and collect
statistics on the view.
```sql
CREATE INCREMENTAL MATERIALIZED VIEW mvt1 AS SELECT c1 AS mc1, c2 AS mc2,
ABS(c2) AS mc3, ABS(ABS(c2) - c1 - 1) AS mc4
@@ -66,13 +72,13 @@ To enable AQUMV, you need to create a materialized view and
set the value of the
ANALYZE mvt1;
```
-5. Enable the AQUMV-related configuration parameter.
+6. Enable the AQUMV-related configuration parameter.
```sql
SET enable_answer_query_using_materialized_views = ON;
```
-6. Now AQUMV is enabled. Execute the same query again, which takes only 45.701
ms.
+7. Now AQUMV is enabled. Execute the same query again, which takes only 45.701
ms.
```sql
SELECT SQRT(ABS(ABS(c2) - c1 - 1) + ABS(c2)) FROM aqumv_t1 WHERE c1 > 30
AND c1 < 40 AND SQRT(ABS(c2)) > 5.8;
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/parallel-create-ao-refresh-mv.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/parallel-create-ao-refresh-mv.md
similarity index 97%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/parallel-create-ao-refresh-mv.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/parallel-create-ao-refresh-mv.md
index 32258431..990eb622 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/current/parallel-create-ao-refresh-mv.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/parallel-create-ao-refresh-mv.md
@@ -125,6 +125,6 @@ title: 并行创建 AO/AOCO 表与刷新物化视图
## 相关其他特性
-[自动使用物化视图进行查询优化](/i18n/zh/docusaurus-plugin-content-docs/current/use-auto-materialized-view-to-answer-queries.md)
+[自动使用物化视图进行查询优化](/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-auto-materialized-view-to-answer-queries.md)
-[增量物化视图说明文档](/i18n/zh/docusaurus-plugin-content-docs/current/use-incremental-materialized-view.md)
+[增量物化视图说明文档](/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-incremental-materialized-view.md)
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/parallel-query-execution.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/parallel-query-execution.md
similarity index 100%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/parallel-query-execution.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/parallel-query-execution.md
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/update-stats-using-analyze.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/update-stats-using-analyze.md
similarity index 100%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/update-stats-using-analyze.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/update-stats-using-analyze.md
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/use-aggre-pushdown-to-speed-up-queries.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-aggre-pushdown-to-speed-up-queries.md
similarity index 100%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/use-aggre-pushdown-to-speed-up-queries.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/use-aggre-pushdown-to-speed-up-queries.md
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/use-auto-materialized-view-to-answer-queries.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-auto-materialized-view-to-answer-queries.md
similarity index 91%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/use-auto-materialized-view-to-answer-queries.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/use-auto-materialized-view-to-answer-queries.md
index 57ba55c8..d5f64d0d 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/current/use-auto-materialized-view-to-answer-queries.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-auto-materialized-view-to-answer-queries.md
@@ -16,20 +16,26 @@ title: 自动使用物化视图进行查询优化
要启用 AQUMV 功能,需要先创建物化视图,并将系统参数 `enable_answer_query_using_materialized_views`
的值设为 `ON`。下面是不使用 AQUMV 与使用 AQUMV 执行相同复杂查询的结果对比。
-1. 创建表格 `aqumv_t1`。
+1. 关闭 GPORCA 执行优化器,使用基于 Postgres 的执行优化器。
+
+ ```sql
+ SET optimizer TO off;
+ ```
+
+2. 创建表格 `aqumv_t1`。
```sql
CREATE TABLE aqumv_t1(c1 INT, c2 INT, c3 INT) DISTRIBUTED BY (c1);
```
-2. 往表中插入数据,并收集表上的统计信息。
+3. 往表中插入数据,并收集表上的统计信息。
```sql
INSERT INTO aqumv_t1 SELECT i, i+1, i+2 FROM generate_series(1, 100000000)
i;
ANALYZE aqumv_t1;
```
-3. 在不开启 AQUMV 的情况下执行查询,耗时 7384.329 ms。
+4. 在不开启 AQUMV 的情况下执行查询,耗时 7384.329 ms。
```sql
SELECT SQRT(ABS(ABS(c2) - c1 - 1) + ABS(c2)) FROM aqumv_t1 WHERE c1 > 30
AND c1 < 40 AND SQRT(ABS(c2)) > 5.8;
@@ -57,7 +63,7 @@ title: 自动使用物化视图进行查询优化
(4 rows)
```
-4. 现在基于 `aqumv_t1` 创建物化视图 `mvt1`,并收集该视图的统计信息。
+5. 现在基于 `aqumv_t1` 创建物化视图 `mvt1`,并收集该视图的统计信息。
```sql
CREATE INCREMENTAL MATERIALIZED VIEW mvt1 AS SELECT c1 AS mc1, c2 AS mc2,
ABS(c2) AS mc3, ABS(ABS(c2) - c1 - 1) AS mc4
@@ -66,13 +72,13 @@ title: 自动使用物化视图进行查询优化
ANALYZE mvt1;
```
-5. 开启 AQUMV 相关配置参数:
+6. 开启 AQUMV 相关配置参数:
```sql
SET enable_answer_query_using_materialized_views = ON;
```
-6. 现在 AQUMV 已开启,再次执行相同的表查询,耗时 45.701 ms。
+7. 现在 AQUMV 已开启,再次执行相同的表查询,耗时 45.701 ms。
```sql
SELECT SQRT(ABS(ABS(c2) - c1 - 1) + ABS(c2)) FROM aqumv_t1 WHERE c1 > 30
AND c1 < 40 AND SQRT(ABS(c2)) > 5.8;
@@ -127,6 +133,6 @@ AQUMV 是通过对查询树进行等效转换来实现查询优化的。
## 相关其他功能
-[并行创建 AO
表与刷新物化视图](/i18n/zh/docusaurus-plugin-content-docs/current/parallel-create-ao-refresh-mv.md)
+[并行创建 AO
表与刷新物化视图](/i18n/zh/docusaurus-plugin-content-docs/current/performance/parallel-create-ao-refresh-mv.md)
-[增量物化视图说明文档](/i18n/zh/docusaurus-plugin-content-docs/current/use-incremental-materialized-view.md)
+[增量物化视图说明文档](/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-incremental-materialized-view.md)
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/use-incremental-materialized-view.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-incremental-materialized-view.md
similarity index 98%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/use-incremental-materialized-view.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/use-incremental-materialized-view.md
index cf3d43b8..0d62906a 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/current/use-incremental-materialized-view.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-incremental-materialized-view.md
@@ -245,6 +245,6 @@ CREATE [INCREMENTAL] MATERIALIZED VIEW [ IF NOT EXISTS ]
table_name
# 其他相关功能
-[并行创建 AO
表与刷新物化视图](/i18n/zh/docusaurus-plugin-content-docs/current/parallel-create-ao-refresh-mv.md)
+[并行创建 AO
表与刷新物化视图](/i18n/zh/docusaurus-plugin-content-docs/current/performance/parallel-create-ao-refresh-mv.md)
-[自动使用物化视图进行查询优化](/i18n/zh/docusaurus-plugin-content-docs/current/use-auto-materialized-view-to-answer-queries.md)
+[自动使用物化视图进行查询优化](/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-auto-materialized-view-to-answer-queries.md)
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/use-index-scan-on-ao-tables.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-index-scan-on-ao-tables.md
similarity index 100%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/use-index-scan-on-ao-tables.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/use-index-scan-on-ao-tables.md
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/use-runtimefilter-to-optimize-queries.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-runtimefilter-to-optimize-queries.md
similarity index 100%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/use-runtimefilter-to-optimize-queries.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/use-runtimefilter-to-optimize-queries.md
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/use-unique-index-on-ao-tables.md
b/i18n/zh/docusaurus-plugin-content-docs/current/performance/use-unique-index-on-ao-tables.md
similarity index 100%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/use-unique-index-on-ao-tables.md
rename to
i18n/zh/docusaurus-plugin-content-docs/current/performance/use-unique-index-on-ao-tables.md
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]