You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/developer/lightweight-update.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
slug: /guides/developer/lightweight-update
3
-
sidebar_label: 'On-fly Mutation'
4
-
title: 'On-fly Mutations'
5
-
keywords: ['On-fly mutation']
6
-
description: 'Provides a description of on-fly mutations'
3
+
sidebar_label: 'On-the-fly mutation'
4
+
title: 'On-the-fly Mutations'
5
+
keywords: ['On-the-fly mutation']
6
+
description: 'Provides a description of on-the-fly mutations'
7
7
---
8
8
9
-
## On-fly mutation {#lightweight-update}
9
+
## On-the-fly mutations {#lightweight-update}
10
10
11
-
When on-fly mutations are enabled, updated rows are marked as updated immediately and subsequent `SELECT` queries will automatically return with the changed values. When on-fly mutations are not enabled, you may have to wait for your mutations to be applied via a background process to see the changed values.
11
+
When on-the-fly mutations are enabled, updated rows are marked as updated immediately and subsequent `SELECT` queries will automatically return with the changed values. When on-the-fly mutations are not enabled, you may have to wait for your mutations to be applied via a background process to see the changed values.
12
12
13
-
On-fly mutations can be enabled for `MergeTree`-family tables by enabling the query-level setting `apply_mutations_on_fly`.
13
+
On-the-fly mutations can be enabled for `MergeTree`-family tables by enabling the query-level setting `apply_mutations_on_fly`.
14
14
15
15
```sql
16
16
SET apply_mutations_on_fly =1;
@@ -56,10 +56,10 @@ Note that the values of the rows have not yet been updated when we query the new
56
56
└────┴───┘
57
57
```
58
58
59
-
Let's now see what happens when we enable on-fly mutations:
59
+
Let's now see what happens when we enable on-the-fly mutations:
60
60
61
61
```sql
62
-
-- Enable on-fly mutations
62
+
-- Enable on-the-fly mutations
63
63
SET apply_mutations_on_fly =1;
64
64
65
65
SELECT id, v FROM test_on_fly_mutations ORDER BY id;
@@ -75,15 +75,15 @@ The `SELECT` query now returns the correct result immediately, without having to
75
75
76
76
## Performance impact {#performance-impact}
77
77
78
-
When on-fly mutations are enabled, mutations are not materialized immediately but will only be applied during `SELECT` queries. However, please note that mutations are still being materialized asynchronously in the background, which is a heavy process.
78
+
When on-the-fly mutations are enabled, mutations are not materialized immediately but will only be applied during `SELECT` queries. However, please note that mutations are still being materialized asynchronously in the background, which is a heavy process.
79
79
80
80
If the number of submitted mutations constantly exceeds the number of mutations that are processed in the background over some time interval, the queue of unmaterialized mutations that have to be applied will continue to grow. This will result in the eventual degradation of `SELECT` query performance.
81
81
82
82
We suggest enabling the setting `apply_mutations_on_fly` together with other `MergeTree`-level settings such as `number_of_mutations_to_throw` and `number_of_mutations_to_delay` to restrict the infinite growth of unmaterialized mutations.
83
83
84
84
## Support for subqueries and non-deterministic functions {#support-for-subqueries-and-non-deterministic-functions}
85
85
86
-
On-fly mutations have limited support with subqueries and non-deterministic functions. Only scalar subqueries with a result that have a reasonable size (controlled by the setting `mutations_max_literal_size_to_replace`) are supported. Only constant non-deterministic functions are supported (e.g. the function `now()`).
86
+
On-the-fly mutations have limited support with subqueries and non-deterministic functions. Only scalar subqueries with a result that have a reasonable size (controlled by the setting `mutations_max_literal_size_to_replace`) are supported. Only constant non-deterministic functions are supported (e.g. the function `now()`).
87
87
88
88
These behaviours are controlled by the following settings:
0 commit comments