Top.Mail.Ru
index_object:max() | Tarantool
Tarantool
Check out the new release 2.8

index_object:max()

object index_object
index_object:max([key])

Find the maximum value in the specified index.

Parameters:
  • index_object (index_object) – an object reference.
  • key (scalar/table) – values to be matched against the index key
Return:

the tuple for the last key in the index. If optional key value is supplied, returns the last key which is less than or equal to key value. In a future version of Tarantool, index:max(key value) will return nothing if key value is not equal to a value in the index.

Rtype:

tuple

Possible errors: index is not of type ‘TREE’.

Complexity factors: Index size, Index type.

Example:

tarantool> box.space.tester.index.primary:max()
---
- ['Gamma!', 55, 'This is the third tuple!']
...