Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH] schema: rework index sequence API
Date: Mon, 27 May 2019 22:38:46 +0300	[thread overview]
Message-ID: <20190527193846.GA7254@atlas> (raw)
In-Reply-To: <5533af44673160684c608bec811109721bef5d36.1558972156.git.vdavydov.dev@gmail.com>

* Vladimir Davydov <vdavydov.dev@gmail.com> [19/05/27 22:25]:
> Rather than passing 'sequence_part' along with 'sequence' on index
> create/alter, pass a table with the following fields:
> 
>  - id: sequence id or name
>  - field: auto increment field id or name or path in case of json index
> 
> If id is omitted, the sequence will be auto-generated (equivalent to
> 'sequence = true'). If field is omitted, the first indexed field is
> used. Old format, i.e. passing false/true or sequence name/id instead of
> a table is still supported.

Hi,

Thank you for the patch.

I certainly do not appreciate lack of changes in _space_sequence
definition.

You do hope, it seems, that mentioning field name in the sequence
name is a stupid idea, and will be reverted some day.
Meanwhile all front ends will have to resolve the field to path to
build a proper statement for _space_sequence.

> +s.index.pk:alter{sequence = false}
> +s.index.pk:alter{sequence = {field = 'x.a.b[1]'}}
> +s:replace{{a = {b = {box.NULL}}}} -- ok

What happens when I rename the field using space::format()?
Does sequence continue to work? Which field is it using then? 

What happens when if I alter the index and modify its part names, order
or count? The answer to this question depends on whether
_sequence_space stores the path or the part.

If you think using a field is a stupid idea and the core should
continue using part no, please, test the consequences of this at
least.

-- 
Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2019-05-27 19:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 16:00 Vladimir Davydov
2019-05-27 19:38 ` Konstantin Osipov [this message]
2019-05-28  7:41   ` [tarantool-patches] " Vladimir Davydov
2019-05-28  9:38     ` Konstantin Osipov

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=20190527193846.GA7254@atlas \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] schema: rework index sequence API' \
    /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