From: Konstantin Osipov <kostja@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v2 11/14] vinyl: do not fill secondary tuples with nulls when decoded
Date: Wed, 13 Mar 2019 15:25:59 +0300 [thread overview]
Message-ID: <20190313122559.GK25066@chai> (raw)
In-Reply-To: <00072f9869878409ebefa45232b5015a8441a655.1552464666.git.vdavydov.dev@gmail.com>
* Vladimir Davydov <vdavydov.dev@gmail.com> [19/03/13 11:58]:
> +struct key_def *
> +key_def_extract(const struct key_def *cmp_def, const struct key_def *pk_def,
> + struct region *region)
The name is not very telling :(
It also looks like a standalone function, not a key_def method. So
we could name it build_pk_def_for_cmp_def or
find_primary_key_parts() or something like it.
> if (lsm == NULL) {
> free(index);
> return NULL;
> @@ -1301,13 +1300,34 @@ vy_get_by_secondary_tuple(struct vy_lsm *lsm, struct vy_tx *tx,
> const struct vy_read_view **rv,
> struct tuple *tuple, struct tuple **result)
> {
> + int rc = 0;
> assert(lsm->index_id > 0);
>
> - if (vy_point_lookup(lsm->pk, tx, rv, tuple, result) != 0)
> - return -1;
> + /*
> + * Lookup the full tuple by a secondary statement.
> + * There are two cases: the secondary statement may be
> + * a key, in which case we need to extract the primary
Please explain:
may be a key, if we got this tuple from disk ... or may be a full
tuple if we got this tuple from the tuple cache or level 0,
> + * key parts from it; or it may be a full tuple, which
> + * we may pass it immediately to the iterator.
> + */
> + struct tuple *key;
> + /*
> + * To save disk space, we do not store full tuples
> + * in secondary index runs. Instead we only store
> + * extended keys (i.e. keys consisting of secondary
> + * and primary index parts). This is enough to look
> + * up a full tuple in the primary index.
> + */
> + lsm->disk_format = lsm_env->key_format;
Nice.
> +
> + lsm->pk_in_cmp_def = key_def_extract(lsm->cmp_def, pk->key_def,
Oh. Shall we call the function find_pk_in_cmp_def()?
> + if (is_primary)
> + stmt = vy_stmt_new_surrogate_from_key(request.key,
Shouldn't this be renamed?
> + IPROTO_DELETE,
> key_def, format);
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
next prev parent reply other threads:[~2019-03-13 12:25 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 8:52 [PATCH v2 00/14] vinyl: do not fill secondary tuples with nulls Vladimir Davydov
2019-03-13 8:52 ` [PATCH v2 01/14] vinyl: remove optimized comparators Vladimir Davydov
2019-03-13 8:55 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 02/14] vinyl: introduce statement environment Vladimir Davydov
2019-03-13 8:58 ` Konstantin Osipov
2019-03-13 9:19 ` Vladimir Davydov
2019-03-13 8:52 ` [PATCH v2 03/14] vinyl: rename key stmt construction routine Vladimir Davydov
2019-03-13 8:59 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 04/14] vinyl: don't use IPROTO_SELECT type for key statements Vladimir Davydov
2019-03-13 9:00 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 05/14] bloom: do not use tuple_common_key_parts when constructing tuple bloom Vladimir Davydov
2019-03-13 11:52 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 06/14] bloom: factor out helper to add tuple hash to bloom builder Vladimir Davydov
2019-03-13 11:52 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 07/14] vinyl: add helpers to add/check statement with bloom Vladimir Davydov
2019-03-13 11:59 ` Konstantin Osipov
2019-03-13 12:25 ` Vladimir Davydov
2019-03-13 8:52 ` [PATCH v2 08/14] vinyl: do not pass format to vy_apply_upsert Vladimir Davydov
2019-03-13 12:00 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 09/14] vinyl: clean up write iterator source destruction Vladimir Davydov
2019-03-13 12:05 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 10/14] vinyl: zap vy_write_iterator->format Vladimir Davydov
2019-03-13 12:06 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 11/14] vinyl: do not fill secondary tuples with nulls when decoded Vladimir Davydov
2019-03-13 12:25 ` Konstantin Osipov [this message]
2019-03-13 12:45 ` Vladimir Davydov
2019-03-13 12:56 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 12/14] vinyl: zap vy_stmt_new_surrogate_from_key Vladimir Davydov
2019-03-13 12:27 ` Konstantin Osipov
2019-03-13 8:52 ` [PATCH v2 13/14] vinyl: don't use vy_stmt_new_surrogate_delete if not necessary Vladimir Davydov
2019-03-13 12:28 ` Konstantin Osipov
2019-03-13 8:53 ` [PATCH v2 14/14] tuple_format: zap min_tuple_size Vladimir Davydov
2019-03-13 12:28 ` Konstantin Osipov
2019-03-13 15:54 ` [PATCH v2 00/14] vinyl: do not fill secondary tuples with nulls Vladimir Davydov
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=20190313122559.GK25066@chai \
--to=kostja@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [PATCH v2 11/14] vinyl: do not fill secondary tuples with nulls when decoded' \
/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