From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8DA3C46971A for ; Sat, 7 Dec 2019 19:34:53 +0300 (MSK) References: <44d1754c-ee10-aac5-3fdf-66aad8b2fd70@tarantool.org> From: Vladislav Shpilevoy Message-ID: <88a6e30a-8832-89c3-f553-9f234b7accd7@tarantool.org> Date: Sat, 7 Dec 2019 17:34:49 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH v2 0/3] Add constraint names hash table to space List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Khabibov , tarantool-patches@dev.tarantool.org Hi! Thanks for the fixes! On 04/12/2019 17:23, Roman Khabibov wrote: > > >> On Nov 30, 2019, at 04:03, Vladislav Shpilevoy wrote: >> >> Hi! Thanks for the patch! >> >> See 2 comments below! >> >> On 28/11/2019 19:34, Roman Khabibov wrote: >>> I have made essential changes to the previous patch, so I decided >>> to send it as v2. >>> >>> 1) I still don't understand, why we need to store constraint id. If we have the >>> query "ALTER TABLE T DROP CONSTRAINT C", we just get struct space by its name, >>> then find the corresponding constraint_def node by the name and emit opcode on >>> replace in _index/_fk_constraint/_ck_constraint depending on >>> constraint_def->type. >> >> 1. ID is a primary index. You can delete by ID. Is it always >> possible to delete by name? Do all the constraint spaces have a >> unique index over name consisting of one column? > I know a space_id. So, I will delete tuples from _index, _ck, _fk by their unique > composite indexes: > +----------+------------+ > | space_id | name/iid | > +----------+------------+ > > If we want to delete by ID, let’s add it to _ck and _fk and keep it in struct constraint_def also. But, IMO, it is not about my patchset. > You are right - ID won't help here. _index/_ck/_fk anyway either have a unique index by , or does not have their own ID. So constraint ID won't help.