From db8e15d2364c520bafe4453093110690993c39ac Mon Sep 17 00:00:00 2001 From: mar Date: Wed, 20 May 2026 22:10:38 +0300 Subject: [PATCH 1/2] doc: add index_opts_layout option --- .../reference_lua/box_space/create_index.rst | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/doc/reference/reference_lua/box_space/create_index.rst b/doc/reference/reference_lua/box_space/create_index.rst index 3283cb0dd4..82ecf30dc2 100644 --- a/doc/reference/reference_lua/box_space/create_index.rst +++ b/doc/reference/reference_lua/box_space/create_index.rst @@ -264,6 +264,51 @@ index_opts | Type: number | Default: :ref:`vinyl.run_size_ratio ` + + .. _index_opts_layout: + + .. data:: layout + + **MemCS only** + + Specify how a column within the index is physically stored. + + Possible values: + + * If not set (or set to an empty string), the default plain layout is used. + * If set to `null_rle`, run-length encoding of `NULL` values is used. Applies to nullable columns that are not listed in index `parts`. + + For example: + + .. code-block:: lua + + local format = { + { 'c1', 'unsigned' }, + { 'c2', 'unsigned', is_nullable = true }, + { 'c3', 'unsigned', is_nullable = true }, + { 'c4', 'unsigned' }, + { 'c5', 'unsigned', is_nullable = true }, + } + + box.schema.create_space('test', { + engine = 'memcs', format = format, field_count = #format + }) + + box.space.test:create_index('primary', { + parts = { 'c1' }, layout = 'null_rle' + }) + + box.space.test:create_index('secondary', { + parts = { 'c1', 'c2' }, covers = { 'c3', 'c4' }, layout = 'null_rle' + }) + + In this example, the `null_rle` layout is applied to `c2, `c3`, `c5` + in the primary index, and to `c3` in the secondary index. + + | + | Type: string + | Default: not set + .. _key_part_object: key_part From a136e3c26ce6c641faa733f1b44efab467a80009 Mon Sep 17 00:00:00 2001 From: mar Date: Thu, 21 May 2026 13:08:52 +0300 Subject: [PATCH 2/2] doc: add index_opts_layout option --- doc/reference/reference_lua/box_space/create_index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/reference/reference_lua/box_space/create_index.rst b/doc/reference/reference_lua/box_space/create_index.rst index 82ecf30dc2..f944985786 100644 --- a/doc/reference/reference_lua/box_space/create_index.rst +++ b/doc/reference/reference_lua/box_space/create_index.rst @@ -275,7 +275,7 @@ index_opts Possible values: - * If not set (or set to an empty string), the default plain layout is used. + * If not set (or set to `plain`), the default plain layout is used. * If set to `null_rle`, run-length encoding of `NULL` values is used. Applies to nullable columns that are not listed in index `parts`. For example: @@ -302,7 +302,7 @@ index_opts parts = { 'c1', 'c2' }, covers = { 'c3', 'c4' }, layout = 'null_rle' }) - In this example, the `null_rle` layout is applied to `c2, `c3`, `c5` + In this example, the `null_rle` layout is applied to `c2`, `c3`, `c5` in the primary index, and to `c3` in the secondary index. |