Skip to content

Commit 7fe1301

Browse files
authored
Update metric_log_ram.md
1 parent 46c82a0 commit 7fe1301

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

content/en/altinity-kb-setup-and-maintenance/metric_log_ram.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,17 @@ In addition to `metric_log`, other tables may also be affected — particularly
146146
```xml
147147
<clickhouse>
148148
<merge_tree>
149-
<min_bytes_for_wide_part>134217728</min_bytes_for_wide_part>
150-
<vertical_merge_algorithm_min_bytes_to_activate>134217728</vertical_merge_algorithm_min_bytes_to_activate>
149+
<min_bytes_for_wide_part>0</min_bytes_for_wide_part> <!-- disable size based threshold for wide part -->
150+
<min_rows_for_wide_part>131072</min_rows_for_wide_part> <!-- use row based instread, same value as vertical_merge_algorithm_min_rows_to_activate -->
151151
</merge_tree>
152152
</clickhouse>
153153
```
154154

155155
These settings tell ClickHouse® to **keep using compact parts longer**
156156
and to **enable the vertical merge algorithm** simultaneously with the switch to the wide format, preventing sudden spikes in memory usage.
157157

158+
Caution: the vertical merge directly from compact parts to wide part can be VERY slow.
159+
158160
---
159161

160162
### ⚠️ Potential Risks and Trade-offs
@@ -165,6 +167,8 @@ The trade-off is that this layout makes **reads less efficient** for column-sele
165167

166168
Lowering thresholds for vertical merges further decreases merge memory but may make the first merges slower, as they process columns sequentially. This configuration works best for **wide, append-only tables** or **S3-based storage**, while analytical tables with frequent updates or narrow schemas may perform better with defaults. If merge memory or S3 request overhead is your main concern, applying it globally is reasonable — otherwise, start with specific wide tables like `system.metric_log`, verify performance improvements, and expand gradually.
167169

170+
Additionally the the vertical merge directly from compact parts to wide part can be VERY slow.
171+
168172
---
169173

170174
**Summary**

0 commit comments

Comments
 (0)