From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2DBFF2E572 for ; Mon, 27 May 2019 15:38:51 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tcsSfZESTpOV for ; Mon, 27 May 2019 15:38:51 -0400 (EDT) Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 6D05E2E521 for ; Mon, 27 May 2019 15:38:50 -0400 (EDT) Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1hVLSK-0001I7-Fb for tarantool-patches@freelists.org; Mon, 27 May 2019 22:38:48 +0300 Date: Mon, 27 May 2019 22:38:46 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH] schema: rework index sequence API Message-ID: <20190527193846.GA7254@atlas> References: <5533af44673160684c608bec811109721bef5d36.1558972156.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5533af44673160684c608bec811109721bef5d36.1558972156.git.vdavydov.dev@gmail.com> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org * Vladimir Davydov [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