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 78DC428C9B for ; Tue, 16 Apr 2019 10:12:55 -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 XUpO8ZIfU-Po for ; Tue, 16 Apr 2019 10:12:55 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 C93D42A3C6 for ; Tue, 16 Apr 2019 10:12:54 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 5/9] sql: improve type determination for column meta References: From: Vladislav Shpilevoy Message-ID: <9edb1536-e63c-d9ab-5130-1f38b822d698@tarantool.org> Date: Tue, 16 Apr 2019 17:12:52 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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, Nikita Pettik Cc: kostja@tarantool.org On 14/04/2019 18:04, Nikita Pettik wrote: > In most cases we don't assign and store type of node of expression AST > (except for constant literals). To determine type of node we use > sql_expr_type() function, which implements logic of quite simple > recursive tree traversal. Before this patch we set type of node after > code generation in sqlExprCodeTarget() without any traversal. This > approach is way worse even then sql_expr_type(). Why? How is recursive scan of the tree better than simple access to a struct's attribute? I see, that your patch improves type determination precision, but I do not understand how, and what a perf price for that? If you are not sure about the price, we could ask Alexander to run benches on your branch before pushing into the master. > So, to improve accuracy > of type determination, let's always call that method and remove type > assignment in sqlExprCodeTarget(). This patch fixes the issue https://github.com/tarantool/tarantool/issues/4126. > --- > src/box/sql/expr.c | 19 ++++--------------- > src/box/sql/select.c | 2 +- > test/sql/check-clear-ephemeral.result | 2 +- > test/sql/gh-2347-max-int-literals.result | 2 +- > test/sql/gh-3199-no-mem-leaks.result | 18 +++++++++--------- > test/sql/gh-3888-values-blob-assert.result | 2 +- > test/sql/persistency.result | 8 ++++---- > test/sql/transition.result | 4 ++-- > test/sql/types.result | 10 +++++----- > 9 files changed, 28 insertions(+), 39 deletions(-) >