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: ydb/docs/en/core/yql/reference/syntax/alter-sequence.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ ALTER SEQUENCE `/Root/users/_serial_column_user_id`
47
47
RESTART 1000;
48
48
```
49
49
50
-
An alternative way to achieve the same result is to first change the start value, and then `RESTART` the `Sequence`. After this, subsequent calls to `RESTART` without an explicit value will set the current value to 1000:
50
+
An alternative way to change the current value is to first set a new start value, and then `RESTART` the `Sequence`. After this, subsequent calls to `RESTART` without an explicit value will set the current value to 1000:
51
51
52
52
```yql
53
53
ALTER SEQUENCE `/Root/users/_serial_column_user_id` INCREMENT BY 5 START WITH 1000;
Copy file name to clipboardExpand all lines: ydb/docs/en/core/yql/reference/types/serial.md
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,11 @@ At present, the `Sequence` object supports several parameters that determine its
10
10
11
11
By default, values generated by the `Sequence` start from one, are incremented by one with each new value, and are limited according to the chosen type.
12
12
13
-
> **Note:**
14
-
> Serial columns are supported both for columns included in the primary key and for non-key columns.
15
-
>
16
-
> However, such columns cannot be [altered](../syntax/alter_table/family#mod-column-groups) or [dropped](../syntax/alter_table/columns.md) from the table —
17
-
> attempting to perform these operations will result in an error.
13
+
{% note info %}
14
+
Serial columns are supported both for columns included in the primary key and for non-key columns.
15
+
16
+
However, such columns cannot be [altered](../syntax/alter_table/family#mod-column-groups) or [dropped](../syntax/alter_table/columns.md) from the table — attempting to perform these operations will result in an error.
17
+
{% endnote %}
18
18
19
19
| Type | Maximum Value | YDB Type |
20
20
|-------------|----------------------|----------|
@@ -32,8 +32,10 @@ Error: Failed to get next val for sequence: /dev/test/users/_serial_column_user_
32
32
<main>: Error: sequence [OwnerId: <some>, LocalPathId: <some>] doesn't have any more values available, code: 200503
33
33
```
34
34
35
-
**Note:** The next value is allocated by the generator before the actual insertion into the table and is considered used even if the row is not successfully inserted (for example, in case of transaction rollback).
35
+
{% note info %}
36
+
The next value is allocated by the generator before the actual insertion into the table and is considered used even if the row is not successfully inserted (for example, in case of transaction rollback).
36
37
As a result, the values in such a column may have gaps and may not form a continuous sequence.
38
+
{% endnote %}
37
39
38
40
Tables with `Serial` columns support [copy](../../../reference/ydb-cli/tools-copy.md), [rename](../../../reference/ydb-cli/commands/tools/rename.md), [dump](../../../reference/ydb-cli/export-import/tools-dump.md), [restore](../../../reference/ydb-cli/export-import/import-file.md), and [import](../../../reference/ydb-cli/export-import/import-s3.md)/[export](../../../reference/ydb-cli/export-import/export-s3.md) operations.
Copy file name to clipboardExpand all lines: ydb/docs/ru/core/yql/reference/types/serial.md
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,11 @@
11
11
12
12
По умолчанию генерируемые значения начинаются с единицы, увеличиваются на один при каждом новом значении и ограничены в соответствии с выбранным типом.
13
13
14
-
> **Примечание:**
15
-
> Колонки типа `Serial` поддерживаются как для колонок, входящих в состав первичного ключа, так и для неключевых колонок.
16
-
>
17
-
> Однако такие колонки нельзя [изменить](../syntax/alter_table/family#mod-column-groups) или [удалить](../syntax/alter_table/columns.md) из таблицы —
18
-
> при попытке выполнить эти операции будет возвращена ошибка.
14
+
{% note info %}
15
+
Колонки типа `Serial` поддерживаются как для колонок, входящих в состав первичного ключа, так и для неключевых колонок.
16
+
17
+
Однако такие колонки нельзя [изменить](../syntax/alter_table/family#mod-column-groups) или [удалить](../syntax/alter_table/columns.md) из таблицы — при попытке выполнить эти операции будет возвращена ошибка.
@@ -33,7 +33,9 @@ Error: Failed to get next val for sequence: /dev/test/users/_serial_column_user_
33
33
<main>: Error: sequence [OwnerId: <some>, LocalPathId: <some>] doesn't have any more values available, code: 200503
34
34
```
35
35
36
-
Отметим, что следующее значение выдаётся генератором до непосредственной вставки в таблицу и уже будет считаться использованным, даже если строка, содержащая это значение, не была успешно вставлена, например, при откате транзакции. Поэтому множество значений такой колонки может содержать пропуски и состоять из нескольких промежутков.
36
+
{% note info %}
37
+
Cледующее значение выдаётся генератором до непосредственной вставки в таблицу и уже будет считаться использованным, даже если строка, содержащая это значение, не была успешно вставлена, например, при откате транзакции. Поэтому множество значений такой колонки может содержать пропуски и состоять из нескольких промежутков.
38
+
{% endnote %}
37
39
38
40
Для таблиц с автоинкрементными колонками поддержаны операции [copy](../../../reference/ydb-cli/tools-copy.md), [rename](../../../reference/ydb-cli/commands/tools/rename.md), [dump](../../../reference/ydb-cli/export-import/tools-dump.md), [restore](../../../reference/ydb-cli/export-import/import-file.md) и [import](../../../reference/ydb-cli/export-import/import-s3.md)/[export](../../../reference/ydb-cli/export-import/export-s3.md).
39
41
@@ -90,5 +92,5 @@ CREATE TABLE users_bad (
90
92
);
91
93
```
92
94
93
-
В следующем примере автоинкрементная колонка является единственным и первым элементом ключа — это приведёт к неравномерной нагрузке и узкому месту на последней партиции.
95
+
В этом примере автоинкрементная колонка является единственным и первым элементом ключа — это приведёт к неравномерной нагрузке и узкому месту на последней партиции.
0 commit comments