Updated at July 17, 2026 02:08 PM
index_object:random()
index_object
Find a random value in the specified index. This method is useful when it's important to get insight into data distribution in an index without having to iterate over the entire data set.
Parameters:
-
index_object(index_object) — an object reference. -
seed(number) — an arbitrary non-negative integer
Returns
the tuple for the random key in the index.
Return type
tuple
Complexity factors: Index size, Index type.
Note regarding storage engine: vinyl does not support random().
Example:
tarantool> box.space.tester.index.secondary:random(1)---- ['Beta!', 66, 'This is the second tuple!']...