[tarantool-patches] [PATCH 0/3] lua: add key_def lua module

Alexander Turenko alexander.turenko at tarantool.org
Fri Mar 22 19:20:47 MSK 2019


Thank you for the review!

Answers are below.

WBR, Alexander Turenko.

On Fri, Mar 22, 2019 at 05:24:33PM +0300, Kirill Shcherbatov wrote:
> Hi! Can't find the patch that we were discussed, so, I've copied It from branch by my own.
> 
> The code you implemented is very similar in many ways to the one already implemented in key_def.c.
> I have one principal proposal and one advice(may be good enough):
> 1) at first, all map key names must follow their semantic-twin is used with create_index/alter;
>     I mean field, not fieldno e.g.
>     The errors also must not differ, I believe.
>     https://tarantool.io/en/doc/1.10/book/box/box_space/#box-space-create-index

Sadly, create_index/alter format differs from one that is used in
box.space.<...>.index.<...>.parts. I think we definitely should support
the latter one, because typical use case of the key_def module is when
you already have an index and want to use its parts to create a Lua
key_def instance.

> 
> 2) (proposal) I think you can do without the function load_key_def_set_part, that repeats]
>     key_def_decode_parts code in many moments. You may encode tuple on region with
>     lbox_encode_tuple_on_gc() and pass it to key_def_decode_parts(). While key_def:new is
>     not performance-critical, this is better managed way to solve this problem, I think. Consider my
>     RFC diff below:
> 

It would be good to do it in that way (it recuces code duplication), but
I have two possible problems in the mind:

* The formats are different: field vs fieldno.
* Support net.box's collation_id (instead of collation). Maybe this
  problem will gone after fixing #3941.



More information about the Tarantool-patches mailing list