From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E338442F4C7 for ; Tue, 12 Nov 2019 03:51:20 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id g3so15764404ljl.11 for ; Mon, 11 Nov 2019 16:51:20 -0800 (PST) Date: Tue, 12 Nov 2019 00:50:02 +0300 From: Konstantin Osipov Message-ID: <20191111215002.GC25103@atlas> References: <20191111135246.79818-1-korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191111135246.79818-1-korablev@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] box: don't allow referenced collation to be dropped List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org * Nikita Pettik [19/11/11 21:27]: > This patch fixes one debt related to collations: collation is not allowed > to be dropped until at least one space format or index references to it. > Otherwise, we may face situation when collation doesn't exist anymore, > but space has references to it (in-memory DD objects are not updated on > collation alter). To achieve this we simply iterate over all spaces and > check their formats and indexes. Despite it takes > O(space_count * (field_count + index_count)) complexity, it is not a big > deal: drop of collation is considered to be rare operation. So instead > of maintaining reference counters we'd better once spend a bit more > time during drop. Shouldn't you be able to define json path index on 'collation' option and use it for lookup instead? -- Konstantin Osipov, Moscow, Russia