This is an automated email from the ASF dual-hosted git repository. kassiez pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new 1b21887a1b1 update topn_filter_ratio doc (#1316) 1b21887a1b1 is described below commit 1b21887a1b15e77fa5215e807e1e1e14a65f6b2e Author: Pxl <pxl...@qq.com> AuthorDate: Fri Nov 15 20:15:43 2024 +0800 update topn_filter_ratio doc (#1316) # Versions - [X] dev - [X] 3.0 - [ ] 2.1 - [ ] 2.0 # Languages - [X] Chinese - [X] English --- docs/query-acceleration/tuning/runtime-filter.md | 6 +++--- docs/query-acceleration/tuning/topn-query.md | 2 ++ .../current/query-acceleration/tuning/runtime-filter.md | 6 +++--- .../current/query-acceleration/tuning/topn-query.md | 2 ++ .../version-3.0/query-acceleration/tuning/runtime-filter.md | 6 +++--- .../version-3.0/query-acceleration/tuning/topn-query.md | 4 +++- .../version-3.0/query-acceleration/tuning/runtime-filter.md | 6 +++--- versioned_docs/version-3.0/query-acceleration/tuning/topn-query.md | 2 ++ 8 files changed, 21 insertions(+), 13 deletions(-) diff --git a/docs/query-acceleration/tuning/runtime-filter.md b/docs/query-acceleration/tuning/runtime-filter.md index 2efc5af889a..7d508b291e5 100644 --- a/docs/query-acceleration/tuning/runtime-filter.md +++ b/docs/query-acceleration/tuning/runtime-filter.md @@ -423,11 +423,11 @@ As a distributed database, Doris considers the physical machines where TopN and ### Tuning -The session variable `topn_opt_limit_threshold` controls whether to generate a TopN Runtime Filter. +The session variable `topn_filter_ratio` controls whether to generate a TopN Runtime Filter. -The fewer rows specified in the SQL's `limit` clause, the stronger the filtering effect of the TopN Runtime Filter. Therefore, by default, Doris enables the generation of corresponding TopN Runtime Filters only when the `limit` number is less than 1024. +The fewer rows specified in the SQL's `limit` clause, the stronger the filtering effect of the TopN Runtime Filter. Therefore, by default, Doris enables the generation of corresponding TopN Runtime Filters only when the `limit` number is less than half of the data in the table. -For example, setting `set topn_opt_limit_threshold=10` would prevent the generation of a TopN Runtime Filter for the following query: +For example, setting `set topn_filter_ratio=0` would prevent the generation of a TopN Runtime Filter for the following query: ```sql select o_orderkey from orders order by o_orderdate limit 20; diff --git a/docs/query-acceleration/tuning/topn-query.md b/docs/query-acceleration/tuning/topn-query.md index 45a48670a1e..d5b78152b89 100644 --- a/docs/query-acceleration/tuning/topn-query.md +++ b/docs/query-acceleration/tuning/topn-query.md @@ -54,6 +54,8 @@ The following two parameters are session variables that can be set for a specifi 2. `enable_two_phase_read_optimization`: This session variable determines whether to enable this optimization. It defaults to true, and setting it to false disables the optimization. +3. `topn_filter_ratio`, the ratio between LIMIT n and the total data in the table, the default value is 0.5, which means that if the number of LIMIT is more than half of the data in the table, no filter will be generated. + ### Checking if TOPN Query Optimization is Enabled To confirm if TOPN query optimization is enabled for a particular SQL, you can use the `EXPLAIN` statement to get the query plan. An example is as follows: diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/runtime-filter.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/runtime-filter.md index eb3d06cc763..a45e496a7c2 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/runtime-filter.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/runtime-filter.md @@ -418,11 +418,11 @@ mysql> explain select o_orderkey from orders order by o_orderdate limit 5; ### 调优 -Session 变量 `topn_opt_limit_threshold` 可以控制是否生成 TopN Runtime Filter。 +Session 变量 `topn_filter_ratio` 可以控制是否生成 TopN Runtime Filter。 -如果 SQL 中 `limit` 的数量越少,那么 TopN Runtime Filter 的过滤性就越强。因此,系统默认情况下,只有在 `limit` 数量小于 1024 时,才会启用生成对应的 TopN Runtime Filter。 +如果 SQL 中 `limit` 的数量越少,那么 TopN Runtime Filter 的过滤性就越强。因此,系统默认情况下,只有在 `limit` 数量小于 表中数据的一半 时,才会启用生成对应的 TopN Runtime Filter。 -例如,如果设置 `set topn_opt_limit_threshold=10`,那么执行以下查询就不会生成 TopN Runtime Filter。 +例如,如果设置 `set topn_filter_ratio=0`,那么执行以下查询就不会生成 TopN Runtime Filter。 ```sql select o_orderkey from orders order by o_orderdate limit 20; diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/topn-query.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/topn-query.md index 0039660ae56..24b9af52f1b 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/topn-query.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/tuning/topn-query.md @@ -55,6 +55,8 @@ SELECT * FROM tablex WHERE xxx ORDER BY c1,c2 ... LIMIT n 2. `enable_two_phase_read_opt`,是否开启优化 3,默认为 true,可以调为 false 关闭这个优化。 +3. `topn_filter_ratio`,LIMIT n 和表总数据的比率,默认值 0.5,表示 LIMIT 数量多于表中数据的一半则不生成 filter 。 + ### 检查 TOPN 查询优化是否启用 explain SQL 拿到 query plan 可以确认这个 sql 是否启用 TOPN 查询优化,以下面的为例: diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/runtime-filter.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/runtime-filter.md index eb3d06cc763..a45e496a7c2 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/runtime-filter.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/runtime-filter.md @@ -418,11 +418,11 @@ mysql> explain select o_orderkey from orders order by o_orderdate limit 5; ### 调优 -Session 变量 `topn_opt_limit_threshold` 可以控制是否生成 TopN Runtime Filter。 +Session 变量 `topn_filter_ratio` 可以控制是否生成 TopN Runtime Filter。 -如果 SQL 中 `limit` 的数量越少,那么 TopN Runtime Filter 的过滤性就越强。因此,系统默认情况下,只有在 `limit` 数量小于 1024 时,才会启用生成对应的 TopN Runtime Filter。 +如果 SQL 中 `limit` 的数量越少,那么 TopN Runtime Filter 的过滤性就越强。因此,系统默认情况下,只有在 `limit` 数量小于 表中数据的一半 时,才会启用生成对应的 TopN Runtime Filter。 -例如,如果设置 `set topn_opt_limit_threshold=10`,那么执行以下查询就不会生成 TopN Runtime Filter。 +例如,如果设置 `set topn_filter_ratio=0`,那么执行以下查询就不会生成 TopN Runtime Filter。 ```sql select o_orderkey from orders order by o_orderdate limit 20; diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/topn-query.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/topn-query.md index 0039660ae56..8dc898e2880 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/topn-query.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/tuning/topn-query.md @@ -55,6 +55,8 @@ SELECT * FROM tablex WHERE xxx ORDER BY c1,c2 ... LIMIT n 2. `enable_two_phase_read_opt`,是否开启优化 3,默认为 true,可以调为 false 关闭这个优化。 +3. `topn_filter_ratio`,LIMIT n 和表总数据的比率,默认值 0.5,表示 LIMIT 数量多于表中数据的一半则不生成 filter 。 + ### 检查 TOPN 查询优化是否启用 explain SQL 拿到 query plan 可以确认这个 sql 是否启用 TOPN 查询优化,以下面的为例: @@ -88,7 +90,7 @@ explain SQL 拿到 query plan 可以确认这个 sql 是否启用 TOPN 查询优 ### 检查 TOPN 查询优化执行时是否有效果 -首先,可以将 `topn_opt_limit_threshold` 设置为 0 关闭 TOPN 查询优化,对比开启和关闭优化的 SQL 执行时间。 +首先,可以将 `topn_filter_ratio` 设置为 0 关闭 TOPN 查询优化,对比开启和关闭优化的 SQL 执行时间。 开启 TOPN 查询优化后,在 Query Profile 中搜索 RuntimePredicate,关注下面几个指标: diff --git a/versioned_docs/version-3.0/query-acceleration/tuning/runtime-filter.md b/versioned_docs/version-3.0/query-acceleration/tuning/runtime-filter.md index 2efc5af889a..7d508b291e5 100644 --- a/versioned_docs/version-3.0/query-acceleration/tuning/runtime-filter.md +++ b/versioned_docs/version-3.0/query-acceleration/tuning/runtime-filter.md @@ -423,11 +423,11 @@ As a distributed database, Doris considers the physical machines where TopN and ### Tuning -The session variable `topn_opt_limit_threshold` controls whether to generate a TopN Runtime Filter. +The session variable `topn_filter_ratio` controls whether to generate a TopN Runtime Filter. -The fewer rows specified in the SQL's `limit` clause, the stronger the filtering effect of the TopN Runtime Filter. Therefore, by default, Doris enables the generation of corresponding TopN Runtime Filters only when the `limit` number is less than 1024. +The fewer rows specified in the SQL's `limit` clause, the stronger the filtering effect of the TopN Runtime Filter. Therefore, by default, Doris enables the generation of corresponding TopN Runtime Filters only when the `limit` number is less than half of the data in the table. -For example, setting `set topn_opt_limit_threshold=10` would prevent the generation of a TopN Runtime Filter for the following query: +For example, setting `set topn_filter_ratio=0` would prevent the generation of a TopN Runtime Filter for the following query: ```sql select o_orderkey from orders order by o_orderdate limit 20; diff --git a/versioned_docs/version-3.0/query-acceleration/tuning/topn-query.md b/versioned_docs/version-3.0/query-acceleration/tuning/topn-query.md index 45a48670a1e..d5b78152b89 100644 --- a/versioned_docs/version-3.0/query-acceleration/tuning/topn-query.md +++ b/versioned_docs/version-3.0/query-acceleration/tuning/topn-query.md @@ -54,6 +54,8 @@ The following two parameters are session variables that can be set for a specifi 2. `enable_two_phase_read_optimization`: This session variable determines whether to enable this optimization. It defaults to true, and setting it to false disables the optimization. +3. `topn_filter_ratio`, the ratio between LIMIT n and the total data in the table, the default value is 0.5, which means that if the number of LIMIT is more than half of the data in the table, no filter will be generated. + ### Checking if TOPN Query Optimization is Enabled To confirm if TOPN query optimization is enabled for a particular SQL, you can use the `EXPLAIN` statement to get the query plan. An example is as follows: --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org