Skip to content

Commit 744e1e9

Browse files
committed
change default value for cte parameters
1 parent 7934915 commit 744e1e9

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ public class IoTDBConfig {
422422
private long sortBufferSize = 32 * 1024 * 1024L;
423423

424424
/** The buffer for cte scan operation */
425-
private long cteBufferSize = 32 * 1024 * 1024L;
425+
private long cteBufferSize = 128 * 1024L;
426426

427427
/** Max number of rows for cte materialization */
428-
private int maxRowsInCteBuffer = 10000;
428+
private int maxRowsInCteBuffer = 1000;
429429

430430
/** Mods cache size limit per fi */
431431
private long modsCacheSizeLimitPerFI = 32 * 1024 * 1024;

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,13 +1051,22 @@ public void loadProperties(TrimProperties properties) throws BadNodeUrlException
10511051
loadFixedSizeLimitForQuery(properties, "sort_buffer_size_in_bytes", conf::setSortBufferSize);
10521052

10531053
// The buffer for cte materialization.
1054-
loadFixedSizeLimitForQuery(properties, "cte_buffer_size_in_bytes", conf::setCteBufferSize);
1054+
long cteBufferSizeInBytes =
1055+
Long.parseLong(
1056+
properties.getProperty(
1057+
"cte_buffer_size_in_bytes", Long.toString(conf.getCteBufferSize())));
1058+
if (cteBufferSizeInBytes > 0) {
1059+
conf.setCteBufferSize(cteBufferSizeInBytes);
1060+
}
10551061

10561062
// max number of rows for cte materialization
1057-
conf.setMaxRowsInCteBuffer(
1063+
int maxRowsInCteBuffer =
10581064
Integer.parseInt(
10591065
properties.getProperty(
1060-
"max_rows_in_cte_buffer", Integer.toString(conf.getMaxRowsInCteBuffer()))));
1066+
"max_rows_in_cte_buffer", Integer.toString(conf.getMaxRowsInCteBuffer())));
1067+
if (maxRowsInCteBuffer > 0) {
1068+
conf.setMaxRowsInCteBuffer(maxRowsInCteBuffer);
1069+
}
10611070

10621071
loadFixedSizeLimitForQuery(
10631072
properties, "mods_cache_size_limit_per_fi_in_bytes", conf::setModsCacheSizeLimitPerFI);

iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,8 @@ batch_size=100000
11231123
# Datatype: long
11241124
sort_buffer_size_in_bytes=0
11251125

1126-
# The buffer size for CTE materialization. If cte_buffer_size_in_bytes <= 0, default value will be used, default value =
1127-
# min(32MB, memory for query operators / query_thread_count / 2). if cte_buffer_size_in_bytes > 0, the specified value will be used.
1126+
# The buffer size for CTE materialization. If cte_buffer_size_in_bytes <= 0, a default value of 128 KB is used; otherwise the specified value
1127+
# will be used.
11281128
# effectiveMode: hot_reload
11291129
# Datatype: long
11301130
cte_buffer_size_in_bytes=0
@@ -1133,7 +1133,7 @@ cte_buffer_size_in_bytes=0
11331133
# Max rows for CTE materialization
11341134
# effectiveMode: hot_reload
11351135
# Datatype: int
1136-
max_rows_in_cte_buffer=10000
1136+
max_rows_in_cte_buffer=1000
11371137

11381138
# The maximum mod entries size that each FragmentInstance can cache.
11391139
# if mods_cache_size_limit_per_fi_in_bytes <= 0, default value will be used, default value = min(32MB, memory for query operators / query_thread_count / 2)

0 commit comments

Comments
 (0)