[tarantool-patches] Re: [PATCH v4 4/4] box: introduce functional indexes

Kirill Shcherbatov kshcherbatov at tarantool.org
Thu Jul 25 11:27:27 MSK 2019


> I don't understand why you force the user of this module to first
> create a temporary buffer, then iterate over this buffer to create 
> hint objects. Why can't this function return an iterator right
> away, and the iterator itself could return hint_t objects already,
> not individual keys?

E.g. in :replace/delete part we don't need a persistent memory chunk: we need to
evaluate function and iterate over the returned keys to perform a deletion.

===========================================

key_list = key_list_create(old_tuple, cmp_def->func_index_func,
			   &key_list_end, &key_cnt);
if (key_list == NULL)
	goto end;
struct memtx_tree_data data, deleted_data;
data.tuple = old_tuple;
key_list_iterator_create(&it, key_list, key_list_end, cmp_def, true);
const char *key;
uint32_t key_sz;
while (key_list_iterator_next(&it, &key, &key_sz) == 0 &&
       key != NULL) {
	data.hint = (hint_t) key; /* Raw data. */
	deleted_data.tuple = NULL;
	memtx_tree_delete_value(&index->tree, data,
				&deleted_data);
.....



More information about the Tarantool-patches mailing list