Updated at July 17, 2026 02:08 PM
space_object:len()
space_object
Return the number of tuples in the space. If compared with
count(), this method works faster because len() does not scan the
entire space to count the tuples.
Parameters:
space_object(space_object) — an object reference
Returns
Number of tuples in the space.
Possible errors:
ER_TRANSACTION_CONFLICTif a transaction conflict is detected in the MVCC transaction mode.
Example:
tarantool> box.space.tester:len()---- 2...
Note regarding storage engine: vinyl supports len() but the result
may be approximate. If an exact result is necessary then use
count() or
pairs():length().