From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <kostja.osipov@gmail.com>
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 BF21346971A
 for <tarantool-patches@dev.tarantool.org>;
 Wed,  4 Dec 2019 14:59:55 +0300 (MSK)
Received: by mail-lj1-f193.google.com with SMTP id e10so7775290ljj.6
 for <tarantool-patches@dev.tarantool.org>;
 Wed, 04 Dec 2019 03:59:55 -0800 (PST)
Date: Wed, 4 Dec 2019 14:59:54 +0300
From: Konstantin Osipov <kostja.osipov@gmail.com>
Message-ID: <20191204115954.GM6592@atlas>
References: <cover.1574277369.git.korablev@tarantool.org>
 <0a6806665bbc165dffc23967be57135a46bbad62.1574277369.git.korablev@tarantool.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <0a6806665bbc165dffc23967be57135a46bbad62.1574277369.git.korablev@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v2 11/16] sql: introduce
	sql_stmt_sizeof() function
List-Id: Tarantool development patches <tarantool-patches.dev.tarantool.org>
List-Unsubscribe: <https://lists.tarantool.org/mailman/options/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=unsubscribe>
List-Archive: <https://lists.tarantool.org/pipermail/tarantool-patches/>
List-Post: <mailto:tarantool-patches@dev.tarantool.org>
List-Help: <mailto:tarantool-patches-request@dev.tarantool.org?subject=help>
List-Subscribe: <https://lists.tarantool.org/mailman/listinfo/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=subscribe>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org

* Nikita Pettik <korablev@tarantool.org> [19/11/21 10:00]:
> To implement memory quota of prepared statement cache, we have to
> estimate size of prepared statement. This function attempts at that.

I suggest sql_stmt_est_size() as the name.

I would add size-caching right away, to make this function cheap.

if (size != 0)
    return size;

I wonder if we could use another region for the bytecode to 
make this quick & cheap to maintain...

I don't want to sidetrack this work, though.

So lgtm.


-- 
Konstantin Osipov, Moscow, Russia