Tarantool CE/EE Documentation portal logo
Support
Updated at September 7, 2026   01:25 PM

index_object:random()

object index_object

index_object:random(seed)

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

  • 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.

Example:

tarantool> box.space.tester.index.secondary:random(1)---- ['Beta!', 66, 'This is the second tuple!']...