@@ -83,16 +83,16 @@ box.stat.memtx().tx
83
83
84
84
**Example **
85
85
86
- Let's take a look at `used ` and ` retained ` tuples in a transaction.
86
+ Let's get memory statistics for `used ` tuples in a transaction.
87
87
88
- Within the first `` box.cfg() `` call to a new Tarantool instance, we
89
- :ref: ` enable the MVCC engine < txn_mode_mvcc-enabling >` :
88
+ To make transactions work, we need to :ref: ` enable the MVCC engine < txn_mode_mvcc-enabling >`.
89
+ We'll do it within the first `` box.cfg{} `` call to a new Tarantool instance :
90
90
91
91
.. code-block :: lua
92
92
93
93
box.cfg{memtx_use_mvcc_engine = true}
94
94
95
- Next, we create a space with a primary index, and begin a transaction:
95
+ Next, we'll create a space with a primary index, and begin a transaction:
96
96
97
97
.. code-block :: lua
98
98
@@ -106,7 +106,7 @@ Next, we create a space with a primary index, and begin a transaction:
106
106
box.space.test:replace{1, 1}
107
107
box.space.test:replace{2, 1}
108
108
109
- In the transaction above, we replace three tuples by the `0 ` key:
109
+ In the transaction above, we replaced three tuples by the `0 ` key:
110
110
111
111
* ``{0, 0} ``
112
112
* ``{0, 'aa...aa'} ``
@@ -168,3 +168,11 @@ If we call ``box.stat.memtx.tx()`` now, we'll see something like this:
168
168
count: 0
169
169
total: 0
170
170
...
171
+
172
+ Pay attention to highlighted lines -- it's the memory used allocated for `used ` tuples.
173
+
174
+ For a neat experiment, let's commit the transaction:
175
+
176
+ .. code-block :: lua
177
+
178
+ box.commit()
0 commit comments