From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (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 A009C46970E for ; Tue, 17 Dec 2019 17:43:53 +0300 (MSK) Date: Tue, 17 Dec 2019 17:43:52 +0300 From: Kirill Yukhin Message-ID: <20191217144352.2aetfhpiibaehorx@tarantool.org> References: <22cf7005dc67cbc1db717ebbd6aee79660479d84.1574277369.git.korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <22cf7005dc67cbc1db717ebbd6aee79660479d84.1574277369.git.korablev@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 14/16] sql: introduce cache for prepared statemets 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 Hello Nikita, On 21 ноя 00:28, Nikita Pettik wrote: > This patch introduces cache (as data structure) to handle prepared > statements and a set of interface functions (insert, delete, find) to > operate on it. Cache under the hood uses LRU eviction policy. It is > implemented as a hash table with string keys (which contain original SQL > statements) and prepared statements (struct sql_stmt which is an alias > for struct Vdbe) as values. To realise LRU strategy we maintain list of > nodes: head is the newest prepared statement, tail a candidate to be > evicted. Size of cache is regulated via box.cfg{sql_cache_size} > parameter. Cache is global to all sessions. To erase session manually, > one can set its size to 0. Default cache size is assumed to be 5 Mb. > > Part of #2592 Could you please implement prepared statements storage machinery according to proposal posted in `discussions`. Here's the quote: Date: Tue, 22 Oct 2019 15:57:09 +0300 From: Nikita Pettik To: dev@tarantool.org Cc: kostja.osipov@gmail.com, v.shpilevoy@tarantool.org, georgy@tarantool.org, sergos@tarantool.org Subject: Re: [dev] rfc: prepared statements User-Agent: Mutt/1.9.2 (2017-12-15) On 01 Oct 00:16, Nikita Pettik wrote: > Hi everyone, > > RFC in human-readable format is available here: > https://github.com/tarantool/tarantool/blob/np/sql-prepared-stmt-rfc/doc/rfc/2592-prepared-statement.md Yesterday we had discussion concerning prepared statements identifiers. It was decided to use sequential numeric ids instead of strings since strings are likely to add too much overhead on binary protocol payload. All problems which may appear due to cluster configuration were decided to delegate to proxy. Proxy is assumed to take responsibility of mapping query id to appropriate Tarantool instance. -- Regards, Kirill Yukhin