Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v5 3/6] sql: introduce tuple_fetcher class
Date: Wed, 5 Jun 2019 09:47:06 +0300	[thread overview]
Message-ID: <20190605064706.GA16746@atlas> (raw)
In-Reply-To: <20c02296-1a80-a384-cafa-c061f51ad31d@tarantool.org>

* Kirill Shcherbatov <kshcherbatov@tarantool.org> [19/06/03 14:34]:
> Hi! I've renamed tuple_fetcher to vdbe_field_ref as you've proposed.
> Here and everywhere. The corresponding diff below:
> 

A rename is only the first step. It's also about managing the
responsibility. As far as I can see, the new class is a proxy for
an entire tuple, not a single field. This doesn't seem convenient
going forward, but since there is a shared state (the slots array),
let it be. 

But then the name is wrong, it's vdbe_tuple_ref, not
vdbe_field_ref. Why did you blindly rename without objecting to a
another stupid name? 

The next thing is managing the responsibility for the tuple
itself. 

If we begin to think that this is a tuple ref from vdbe, then this
ref should own the tuple, and vdbe should always access the tuple
using this ref. So vdbe_field_ref_create should ref the tuple,
vdbe_field_ref_destroy() should free it. Again, please object if
it doesn't make sense - or it may require some refactoring
(likely).

Finally, the choice of the representation for the slots array and
the implementation itself. When initializing the fetcher class,
you do not consult with vdbe what tuple fields are used. Yet you
do know it from the parsing - and only select fields (one or two)
are used in most cases.

For example: 

CHECK age >=0 and age <= 170 -- sane age

So you don't need to allocate or store a lot of slots in most
cases. Moreover, perhaps it's wise to only use an optimization of
there are few slots in use, and cache Mem objects, not offsets to
fields, and if there are too many slots in use, do nothing?

Please keep in mind that the same object could be used for WHERE,
HAVING or other clauses in the future.


-- 
Konstantin Osipov, Moscow, Russia

  parent reply	other threads:[~2019-06-05 12:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 10:19 [tarantool-patches] [PATCH v5 0/6] box: run checks on insertions in LUA spaces Kirill Shcherbatov
2019-05-23 10:19 ` [tarantool-patches] [PATCH v5 1/6] sql: introduce a new method to bind a pointer Kirill Shcherbatov
2019-05-23 10:19 ` [tarantool-patches] [PATCH v5 2/6] sql: refactor OP_Column vdbe instruction Kirill Shcherbatov
2019-05-23 10:19 ` [tarantool-patches] [PATCH v5 3/6] sql: introduce tuple_fetcher class Kirill Shcherbatov
2019-05-26 12:05   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-31 13:45     ` Kirill Shcherbatov
2019-05-31 19:45       ` Konstantin Osipov
2019-05-31 19:50         ` Kirill Shcherbatov
2019-05-31 22:36         ` Vladislav Shpilevoy
2019-06-01  5:45           ` Konstantin Osipov
2019-06-02 18:50         ` Kirill Shcherbatov
2019-06-03 21:15           ` Vladislav Shpilevoy
2019-06-05  6:47           ` Konstantin Osipov [this message]
2019-06-05  6:48             ` Konstantin Osipov
2019-05-23 10:19 ` [tarantool-patches] [PATCH v5 4/6] schema: add new system space for CHECK constraints Kirill Shcherbatov
2019-05-26 12:06   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-26 13:31     ` n.pettik
2019-05-26 13:32       ` Vladislav Shpilevoy
2019-05-31 13:45     ` Kirill Shcherbatov
2019-06-03 21:15       ` Vladislav Shpilevoy
2019-05-23 10:19 ` [tarantool-patches] [PATCH v5 5/6] box: run check constraint tests on space alter Kirill Shcherbatov
2019-05-26 12:07   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-31 13:45     ` Kirill Shcherbatov
2019-06-03 21:15       ` Vladislav Shpilevoy
2019-05-23 10:19 ` [tarantool-patches] [PATCH v5 6/6] box: user-friendly interface to manage ck constraints Kirill Shcherbatov
2019-05-26 12:07   ` [tarantool-patches] " Vladislav Shpilevoy
2019-05-31 13:45     ` Kirill Shcherbatov
2019-06-03 21:15 ` [tarantool-patches] Re: [PATCH v5 0/6] box: run checks on insertions in LUA spaces Vladislav Shpilevoy
2019-06-04  7:21   ` Kirill Shcherbatov
2019-06-04 18:59     ` Vladislav Shpilevoy
2019-06-06 11:58 ` 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=20190605064706.GA16746@atlas \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH v5 3/6] sql: introduce tuple_fetcher class' \
    /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