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: locale/en/book/box/data_model.pot
+4-237Lines changed: 4 additions & 237 deletions
Original file line number
Diff line number
Diff line change
@@ -47,13 +47,16 @@ msgstr ""
47
47
msgid"Indexes"
48
48
msgstr""
49
49
50
+
msgid"Read the full information about indexes on page :doc:`Indexes </book/box/indexes>`."
51
+
msgstr""
52
+
50
53
msgid"An **index** is a group of key values and pointers."
51
54
msgstr""
52
55
53
56
msgid"As with spaces, you should specify the index **name**, and let Tarantool come up with a unique **numeric identifier** (\"index id\")."
54
57
msgstr""
55
58
56
-
msgid"An index always has a **type**. The default index type is 'TREE'. TREE indexes are provided by all Tarantool engines, can index unique and non-unique values, support partial key searches, comparisons and ordered results. Additionally, memtx engine supports HASH, RTREE and BITSET indexes."
59
+
msgid"An index always has a **type**. The default index type is :ref:`TREE <indexes-tree>`. TREE indexes are provided by all Tarantool engines, can index unique and non-unique values, support partial key searches, comparisons and ordered results. Additionally, memtx engine supports :ref:`HASH <indexes-hash>`, :ref:`RTREE <indexes-rtree>` and :ref:`BITSET <indexes-bitset>` indexes."
57
60
msgstr""
58
61
59
62
msgid"An index may be **multi-part**, that is, you can declare that an index key value is composed of two or more fields in the tuple, in any order. For example, for an ordinary TREE index, the maximum number of parts is 255."
@@ -65,39 +68,6 @@ msgstr ""
65
68
msgid"The first index defined on a space is called the **primary key index**, and it must be unique. All other indexes are called **secondary indexes**, and they may be non-unique."
66
69
msgstr""
67
70
68
-
msgid"An index definition may include identifiers of tuple fields and their expected **types**. See allowed indexed field types :ref:`here <index-box_indexed-field-types>`."
69
-
msgstr""
70
-
71
-
msgid"A recommended design pattern for a data model is to base primary keys on the first fields of a tuple, because this speeds up tuple comparison."
72
-
msgstr""
73
-
74
-
msgid"In our example, we first defined the primary index (named 'primary') based on field #1 of each tuple:"
75
-
msgstr""
76
-
77
-
msgid"tarantool> i = s:create_index('primary', {type = 'hash', parts = {{field = 1, type = 'unsigned'}}}"
78
-
msgstr""
79
-
80
-
msgid"The effect is that, for all tuples in space 'tester', field #1 must exist and must contain an unsigned integer. The index type is 'hash', so values in field #1 must be unique, because keys in HASH indexes are unique."
81
-
msgstr""
82
-
83
-
msgid"After that, we defined a secondary index (named 'secondary') based on field #2 of each tuple:"
84
-
msgstr""
85
-
86
-
msgid"tarantool> i = s:create_index('secondary', {type = 'tree', parts = {field = 2, type = 'string'}})"
87
-
msgstr""
88
-
89
-
msgid"The effect is that, for all tuples in space 'tester', field #2 must exist and must contain a string. The index type is 'tree', so values in field #2 must not be unique, because keys in TREE indexes may be non-unique."
90
-
msgstr""
91
-
92
-
msgid"Space definitions and index definitions are stored permanently in Tarantool's system spaces :ref:`_space <box_space-space>` and :ref:`_index <box_space-index>` (for details, see reference on :ref:`box.space <box_space>` submodule)."
93
-
msgstr""
94
-
95
-
msgid"You can add, drop, or alter the definitions at runtime, with some restrictions. See syntax details in reference on :ref:`box <box-module>` module."
96
-
msgstr""
97
-
98
-
msgid"Read more about index operations :ref:`here <index-box_index-operations>`."
99
-
msgstr""
100
-
101
71
msgid"Data types"
102
72
msgstr""
103
73
@@ -786,209 +756,6 @@ msgstr ""
786
756
msgid"Besides Lua, you can use :ref:`Perl, PHP, Python or other programming language connectors <index-box_connectors>`. The client server protocol is open and documented. See this :ref:`annotated BNF <box_protocol-iproto_protocol>`."
787
757
msgstr""
788
758
789
-
msgid"Index operations"
790
-
msgstr""
791
-
792
-
msgid"Index operations are automatic: if a data-manipulation request changes a tuple, then it also changes the index keys defined for the tuple."
793
-
msgstr""
794
-
795
-
msgid"The simple index-creation operation that we've illustrated before is:"
msgid"This looks for a single tuple via the first index. Since the first index is always unique, the maximum number of returned tuples will be: one. You can call ``select()`` without arguments, causing all tuples to be returned."
811
-
msgstr""
812
-
813
-
msgid"Let's continue working with the space 'tester' created in the :ref:`\"Getting started\" exercises <getting_started_db>` but first modify it:"
814
-
msgstr""
815
-
816
-
msgid"tarantool> box.space.tester:format({\n"
817
-
" > {name = 'id', type = 'unsigned'},\n"
818
-
" > {name = 'band_name', type = 'string'},\n"
819
-
" > {name = 'year', type = 'unsigned'},\n"
820
-
" > {name = 'rate', type = 'unsigned', is_nullable=true}})\n"
msgid"The :ref:`comparison operators <box_index-iterator-types>` are LT, LE, EQ, REQ, GE, GT (for \"less than\", \"less than or equal\", \"equal\", \"reversed equal\", \"greater than or equal\", \"greater than\" respectively). Comparisons make sense if and only if the index type is ‘TREE'."
862
-
msgstr""
863
-
864
-
msgid"This type of search may return more than one tuple; if so, the tuples will be in descending order by key when the comparison operator is LT or LE or REQ, otherwise in ascending order."
865
-
msgstr""
866
-
867
-
msgid"The search can use a secondary index."
868
-
msgstr""
869
-
870
-
msgid"For a primary-key search, it is optional to specify an index name. For a secondary-key search, it is mandatory."
msgid"because a rectangle whose corners are at coordinates ``4,7,5,9`` is entirely within a rectangle whose corners are at coordinates ``3,5,9,10``."
984
-
msgstr""
985
-
986
-
msgid"Additionally, there exist :doc:`index iterator operations </reference/reference_lua/box_index/pairs>`. They can only be used with code in Lua and C/C++. Index iterators are for traversing indexes one key at a time, taking advantage of features that are specific to an index type, for example evaluating Boolean expressions when traversing BITSET indexes, or going in descending order when traversing TREE indexes."
987
-
msgstr""
988
-
989
-
msgid"See also other index operations like :doc:`alter() </reference/reference_lua/box_index/alter>` (modify index) and :doc:`drop() </reference/reference_lua/box_index/drop>` (delete index) in reference for :doc:`/reference/reference_lua/box_index`."
0 commit comments