This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 90a2d7195ac [Feature](inverted index) add no need read data optimize
config #36686 (#38652)
90a2d7195ac is described below
commit 90a2d7195ac95ea26b1a6c05479ffd4a8c45eea4
Author: airborne12 <[email protected]>
AuthorDate: Thu Aug 1 23:22:00 2024 +0800
[Feature](inverted index) add no need read data optimize config #36686
(#38652)
---
be/src/olap/rowset/segment_v2/segment_iterator.cpp | 6 ++++++
.../main/java/org/apache/doris/qe/SessionVariable.java | 15 +++++++++++++++
gensrc/thrift/PaloInternalService.thrift | 1 +
3 files changed, 22 insertions(+)
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index c79a8d33bc2..bfca52cec00 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -1089,6 +1089,9 @@ Status
SegmentIterator::_apply_inverted_index_on_block_column_predicate(
}
bool SegmentIterator::_need_read_data(ColumnId cid) {
+ if (_opts.runtime_state &&
!_opts.runtime_state->query_options().enable_no_need_read_data_opt) {
+ return true;
+ }
// only support DUP_KEYS and UNIQUE_KEYS with MOW
if (!((_opts.tablet_schema->keys_type() == KeysType::DUP_KEYS ||
(_opts.tablet_schema->keys_type() == KeysType::UNIQUE_KEYS &&
@@ -2538,6 +2541,9 @@ void
SegmentIterator::_calculate_pred_in_remaining_conjunct_root(
bool SegmentIterator::_no_need_read_key_data(ColumnId cid,
vectorized::MutableColumnPtr& column,
size_t nrows_read) {
+ if (_opts.runtime_state &&
!_opts.runtime_state->query_options().enable_no_need_read_data_opt) {
+ return false;
+ }
if (_opts.tablet_schema->keys_type() != KeysType::DUP_KEYS) {
return false;
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 82be18cb73d..cdc8569a193 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -340,6 +340,7 @@ public class SessionVariable implements Serializable,
Writable {
public static final String ENABLE_INVERTED_INDEX_QUERY =
"enable_inverted_index_query";
public static final String ENABLE_PUSHDOWN_COUNT_ON_INDEX =
"enable_count_on_index_pushdown";
+ public static final String ENABLE_NO_NEED_READ_DATA_OPT =
"enable_no_need_read_data_opt";
public static final String GROUP_BY_AND_HAVING_USE_ALIAS_FIRST =
"group_by_and_having_use_alias_first";
public static final String DROP_TABLE_IF_CTAS_FAILED =
"drop_table_if_ctas_failed";
@@ -1140,6 +1141,11 @@ public class SessionVariable implements Serializable,
Writable {
"是否启用count_on_index pushdown。", "Set whether to pushdown
count_on_index."})
public boolean enablePushDownCountOnIndex = true;
+ // Whether enable no need read data opt in segment_iterator.
+ @VariableMgr.VarAttr(name = ENABLE_NO_NEED_READ_DATA_OPT, needForward =
true, description = {
+ "是否启用no_need_read_data opt。", "Set whether to enable
no_need_read_data opt."})
+ public boolean enableNoNeedReadDataOpt = true;
+
// Whether enable pushdown minmax to scan node of unique table.
@VariableMgr.VarAttr(name = ENABLE_PUSHDOWN_MINMAX_ON_UNIQUE, needForward
= true, description = {
"是否启用pushdown minmax on unique table。", "Set whether to pushdown
minmax on unique table."})
@@ -2524,6 +2530,14 @@ public class SessionVariable implements Serializable,
Writable {
this.enablePushDownCountOnIndex = enablePushDownCountOnIndex;
}
+ public boolean isEnableNoNeedReadDataOpt() {
+ return enableNoNeedReadDataOpt;
+ }
+
+ public void setEnableNoNeedReadDataOpt(boolean enableNoNeedReadDataOpt) {
+ this.enableNoNeedReadDataOpt = enableNoNeedReadDataOpt;
+ }
+
public int getMaxTableCountUseCascadesJoinReorder() {
return this.maxTableCountUseCascadesJoinReorder;
}
@@ -2643,6 +2657,7 @@ public class SessionVariable implements Serializable,
Writable {
tResult.setFileCacheBasePath(fileCacheBasePath);
tResult.setEnableInvertedIndexQuery(enableInvertedIndexQuery);
+ tResult.setEnableNoNeedReadDataOpt(enableNoNeedReadDataOpt);
if (dryRunQuery) {
tResult.setDryRunQuery(true);
diff --git a/gensrc/thrift/PaloInternalService.thrift
b/gensrc/thrift/PaloInternalService.thrift
index 4d0e7d01b86..c9882e3ee41 100644
--- a/gensrc/thrift/PaloInternalService.thrift
+++ b/gensrc/thrift/PaloInternalService.thrift
@@ -260,6 +260,7 @@ struct TQueryOptions {
92: optional bool enable_parquet_filter_by_min_max = true
93: optional bool enable_orc_filter_by_min_max = true
+ 116: optional bool enable_no_need_read_data_opt = true;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]