User Tools

Site Tools


Sidebar

indexes:rtree_keys

Q. How do I organize a search with two keys? I have column one and column two with numbers, and I need to find a record satisfying this constraint:

one ⇐ [some number] AND two >= [some number]

(2017)

A. You can use an RTREE index.

Here’s a code example:

box.space.some_space:create_index('rtree', {
      type = 'RTREE',
      unique = false,
      dimension = 1,
      distance = 'manhattan',
      parts = {2, 'ARRAY'}
    })

Comments

Enter your comment. Wiki syntax is allowed:
D​ Z T R D
 
indexes/rtree_keys.txt · Last modified: 2018/06/04 16:53 by eabates

Real Time Web Analytics