From: Konstantin Osipov <kostja@tarantool.org>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Cc: tarantool-patches@freelists.org,
Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [tarantool-patches] Re: [PATCH v4 4/4] box: introduce functional indexes
Date: Thu, 25 Jul 2019 11:40:15 +0300 [thread overview]
Message-ID: <20190725084015.GG15185@atlas> (raw)
In-Reply-To: <fdf28e89-8e2b-aa80-b9a8-b51122800657@tarantool.org>
* Kirill Shcherbatov <kshcherbatov@tarantool.org> [19/07/25 11:31]:
> > 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. */
Generally yes, you get the idea, but I don't
get why key is const char *, and why you need key_sz at all.
The iterator can return hint_t right away.
Plus, you can merge key_list_create and key_list_iterator_create
into a single function, there is no reason why one has to perform
two calls instead of one.
> deleted_data.tuple = NULL;
> memtx_tree_delete_value(&index->tree, data,
> &deleted_data);
> .....
--
Konstantin Osipov, Moscow, Russia
next prev parent reply other threads:[~2019-07-25 8:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 7:36 [PATCH v4 0/4] box: " Kirill Shcherbatov
2019-07-24 7:36 ` [PATCH v4 1/4] box: introduce tuple_chunk infrastructure Kirill Shcherbatov
2019-07-24 7:36 ` [PATCH v4 2/4] box: generalize memtx_multikey_tree methods Kirill Shcherbatov
2019-07-24 19:24 ` Konstantin Osipov
2019-07-24 7:36 ` [PATCH v4 3/4] box: refactor memtx_tree_delete_identical Kirill Shcherbatov
2019-07-24 19:24 ` Konstantin Osipov
2019-07-24 7:36 ` [PATCH v4 4/4] box: introduce functional indexes Kirill Shcherbatov
2019-07-24 12:24 ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 19:41 ` Konstantin Osipov
2019-07-24 20:04 ` Konstantin Osipov
2019-07-24 20:22 ` Konstantin Osipov
2019-07-25 11:20 ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 20:44 ` Konstantin Osipov
2019-07-25 11:22 ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 21:07 ` Konstantin Osipov
2019-07-25 8:27 ` [tarantool-patches] " Kirill Shcherbatov
2019-07-25 8:40 ` Konstantin Osipov [this message]
2019-07-25 11:18 ` Kirill Shcherbatov
2019-07-24 21:17 ` Konstantin Osipov
2019-07-24 21:56 ` Konstantin Osipov
2019-07-25 8:33 ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 12:25 ` [tarantool-patches] [PATCH v4 4/5] box: fix memtx_tree_index_build_array_deduplicate Kirill Shcherbatov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190725084015.GG15185@atlas \
--to=kostja@tarantool.org \
--cc=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [tarantool-patches] Re: [PATCH v4 4/4] box: introduce functional indexes' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox