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 5648823DC7 for ; Thu, 17 Jan 2019 08:28:06 -0500 (EST) 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 ccrZaekHqRYp for ; Thu, 17 Jan 2019 08:28:06 -0500 (EST) 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 138E023CAA for ; Thu, 17 Jan 2019 08:28:06 -0500 (EST) Date: Thu, 17 Jan 2019 16:28:02 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 1/2] sql: refactor sql_expr_coll and sql_binary_compare_coll_seq functions Message-ID: <20190117132802.GN28204@chai> References: <276917ac3b405134ae0f075127888912395d511e.1547644179.git.korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <276917ac3b405134ae0f075127888912395d511e.1547644179.git.korablev@tarantool.org> 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 Cc: v.shpilevoy@tarantool.org, Nikita Pettik * Nikita Pettik [19/01/16 17:06]: > Lets make sql_expr_coll() return error code for two reasons. Firstly, > we are going to use this function to detect operands of concatenation > with incompatible collations. Secondly, pointer to struct coll in most > cases is redundant since collation id (which in turn returned via output > parameter) is enough to proceed the same operations. It is redundant but it is potentially faster. What are benefits of changing a pointer to an id? This looks like de-optimization. > For the same reason lets make sql_binary_compare_coll_seq() return > collation id instead of struct coll* and remove corresponding output > parameter. It should be always possible to query id from struct coll. I don't see a reason to operate with ids in the source code anywhere but in DDL. Moreover, if we keep changing it back and forth to our taste it will be a mess. the general rule for space id, index id, coll id is that they should not be used unless necessary for locking/consistency reasons. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov