Top.Mail.Ru
space_object:len() | Tarantool
Submodule box.space / space_object:len()
Tarantool
Check out the new release 2.8
Submodule box.space / space_object:len()

space_object:len()

space_object:len()

object space_object
space_object:len()

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:
Return:

Number of tuples in the space.

Example:

tarantool> box.space.tester:len()
---
- 2
...

Note re storage engine: vinyl supports len() but the result may be approximate. If an exact result is necessary then use count() or pairs():length().