Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org,
	Kirill Shcherbatov <kshcherbatov@tarantool.org>,
	vdavydov.dev@gmail.com
Subject: Re: [tarantool-patches] [PATCH v1 3/8] schema: rework _func system space format
Date: Thu, 30 May 2019 16:10:15 +0300	[thread overview]
Message-ID: <feb6daea-ce34-dc0e-bb2b-853837e50e43@tarantool.org> (raw)
In-Reply-To: <b34c4c1e47360de485bbded5a28c1317337525db.1559212747.git.kshcherbatov@tarantool.org>



On 30/05/2019 13:45, Kirill Shcherbatov wrote:
> This patch updates a _func system space to prepare it for
> working with persistent functions. The format of the _func
> system space is
> [<id> UINT, <owner> UINT, <name> STR, <setuid> UINT,
>  <language> STR, <body> STR, <returns> STR,
>  <is_deterministic> BOOL]

As I understand, a user always should set a function
return type. Even for Lua functions (the only supported
language now, but SQL is coming).

In case of a functional index it should be exactly the same
type as of the index key. For example, if a functional index
has an alone unsigned key part, the function should return
exactly unsigned.

But what about alter? What if I had unsigned function and
key part, but decided to make it 'number' or 'scalar'? I can
do that with normal indexes and space formats, even without
index rebuild or check, for free. In two steps.

Or what if I had 'number', but decided to change it to 'scalar'?
Again, I can do that with index parts and space format, despite
non-transactional DDL, in two steps. Of course, all the tuples
are checked to conform the new stricter format, but it works, and
it is muuuch cheeper than recreate an index.

In your case alter is not possible at all. A user need to drop
the functional index, change type in space format, and create
the index again. Even if type change was 'unsigned' -> 'number'.
It does not match our 'Tarantool is schema less' feature.

Does not look ok, IMO. You could reuse the 'compatible types'
mechanism we use for gradual alter of index parts and space
format.

  parent reply	other threads:[~2019-05-30 13:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 10:45 [PATCH v1 0/8] box: functional indexes Kirill Shcherbatov
2019-05-30 10:45 ` [PATCH v1 1/8] box: refactor box_lua_find helper Kirill Shcherbatov
2019-05-30 10:45 ` [PATCH v1 2/8] box: rework func cache update machinery Kirill Shcherbatov
2019-05-30 10:45 ` [PATCH v1 3/8] schema: rework _func system space format Kirill Shcherbatov
2019-05-30 12:06   ` [tarantool-patches] " Konstantin Osipov
2019-06-03 16:14     ` Vladimir Davydov
2019-05-30 13:10   ` Vladislav Shpilevoy [this message]
2019-05-30 10:45 ` [PATCH v1 4/8] box: load persistent Lua functions on creation Kirill Shcherbatov
2019-05-31  8:16   ` [tarantool-patches] " Konstantin Osipov
2019-06-03  8:26     ` [tarantool-patches] " Kirill Shcherbatov
2019-05-30 10:45 ` [PATCH v1 5/8] netbox: call persistent functions in netbox Kirill Shcherbatov
2019-05-30 10:45 ` [PATCH v1 6/8] box: export _func functions with box.func folder Kirill Shcherbatov
2019-06-03 16:22   ` Vladimir Davydov
2019-06-03 16:24   ` Vladimir Davydov
2019-05-30 10:45 ` [PATCH v1 7/8] box: introduce memtx_slab_alloc helper Kirill Shcherbatov
2019-05-30 10:45 ` [PATCH v1 8/8] box: introduce functional indexes in memtx Kirill Shcherbatov
2019-05-30 11:18 ` [tarantool-patches] [PATCH v1 0/8] box: functional indexes Vladislav Shpilevoy
2019-05-30 11:43   ` [tarantool-patches] " Kirill Shcherbatov
2019-05-30 11:47 ` [tarantool-patches] " Konstantin Osipov
2019-06-03 15:55 ` 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=feb6daea-ce34-dc0e-bb2b-853837e50e43@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] [PATCH v1 3/8] schema: rework _func system space format' \
    /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