From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@freelists.org, v.shpilevoy@tarantool.org
Subject: Re: [tarantool-patches] [PATCH 1/2] space: add method to fetch next rowid
Date: Tue, 30 Oct 2018 11:45:12 +0300 [thread overview]
Message-ID: <20181030084512.li7q5llgflczchf7@esperanza> (raw)
In-Reply-To: <11f65a415a9b1101fa4ba816be237df524de9b47.1540838910.git.korablev@tarantool.org>
On Mon, Oct 29, 2018 at 10:02:05PM +0300, Nikita Pettik wrote:
> Ephemeral space are extensively used in SQL to store intermediate
> results of query processing. To keep things simple, they feature only
> one unique index (primary) which covers all fields. However, ephemeral
> space can be used to store non-unique entries. In this case, one
> additional field added to the end if stored data:
>
> [field1, ... fieldn, rowid]
>
> Note that it can't be added to the beginning of tuple since data in
> ephemeral space may be kept as sorted. Previously, to generate proper
> rowid index_max() was used. However, it is obviously wrong way to do it.
> Hence, lets add simple integer counter to memtx space (ephemeral spaces
> are valid only for memtx engine) and introduce method in vtab to fetch
> next rowid value.
>
> Needed for #3297
> ---
> src/box/blackhole.c | 1 +
> src/box/errcode.h | 2 ++
> src/box/memtx_space.c | 17 +++++++++++++++++
> src/box/memtx_space.h | 7 +++++++
> src/box/space.c | 9 +++++++++
> src/box/space.h | 3 +++
> src/box/sysview.c | 1 +
> src/box/vinyl.c | 1 +
> src/errinj.h | 1 +
> test/box/errinj.result | 2 ++
> test/box/misc.result | 1 +
> 11 files changed, 45 insertions(+)
>
> diff --git a/src/box/blackhole.c b/src/box/blackhole.c
> index aafbfbf65..e34a2dc4a 100644
> --- a/src/box/blackhole.c
> +++ b/src/box/blackhole.c
> @@ -118,6 +118,7 @@ static const struct space_vtab blackhole_space_vtab = {
> /* .execute_upsert = */ blackhole_space_execute_upsert,
> /* .ephemeral_replace = */ generic_space_ephemeral_replace,
> /* .ephemeral_delete = */ generic_space_ephemeral_delete,
> + /* .ephemeral_rowid_next = */ generic_space_ephemeral_rowid_next,
Urgh, I'm starting to think that after all we should tear ephemeral
spaces from the generic space class, because they clutter the memtx
implementation and never going to work with vinyl anyway, because vinyl
has very poor read performance.
I think that we should reimplement ephemeral spaces as a completely
separate entity. Start with in-memory only design, and when there's a
demand make them swappable. May be, we should even consider putting back
the original SQLite implementation.
next prev parent reply other threads:[~2018-10-30 8:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 19:02 [tarantool-patches] [PATCH 0/2] Re-implement rowid generation for ephemeral spaces Nikita Pettik
2018-10-29 19:02 ` [tarantool-patches] [PATCH 1/2] space: add method to fetch next rowid Nikita Pettik
2018-10-30 8:45 ` Vladimir Davydov [this message]
2018-10-30 10:32 ` n.pettik
2018-11-09 9:25 ` [tarantool-patches] " Vladislav Shpilevoy
2018-11-11 23:16 ` n.pettik
2018-11-11 23:22 ` Vladislav Shpilevoy
2018-11-14 23:11 ` n.pettik
2018-11-21 18:58 ` Konstantin Osipov
2018-10-29 19:02 ` [tarantool-patches] [PATCH 2/2] sql: use vtab::rowid_next() instead of index_max() Nikita Pettik
2018-11-09 9:25 ` [tarantool-patches] " Vladislav Shpilevoy
2018-11-15 4:54 ` [tarantool-patches] Re: [PATCH 0/2] Re-implement rowid generation for ephemeral spaces Kirill Yukhin
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=20181030084512.li7q5llgflczchf7@esperanza \
--to=vdavydov.dev@gmail.com \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [tarantool-patches] [PATCH 1/2] space: add method to fetch next rowid' \
/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