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 3A60922726 for ; Mon, 23 Apr 2018 16:31:11 -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 e5mWJNazyfHu for ; Mon, 23 Apr 2018 16:31:11 -0400 (EDT) Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (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 735D922625 for ; Mon, 23 Apr 2018 16:31:10 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 0/4] Move original SQLite's statistics to server Date: Mon, 23 Apr 2018 23:29:37 +0300 Message-Id: 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 Branch: https://github.com/tarantool/tarantool/tree/np/gh-3253-move-statistics-to-server Issue: https://github.com/tarantool/tarantool/issues/3253 This patch-set is about transfering statistics containing in SQL specific struct Table and struct Index to the struct index of Tarantool. Unused statistics are removed at all. First patch of the series provides slight optimization of simple 'SELECT COUNT(*)' query compilation. There is no need to hesistate which index to choose: always use PK. It also allows to remove one usage of statistics from index. Second patch removes obsolete SQLite calculation of average tuple size: it is always possible to get size of space, count of tuples and divide them. Third patch adds simple wrapper to fetch tuple count of given table from server. The last and the main one, introduces new member of index's opts to describe statistics concerning distribution of tuples. Within this patch, routine used to load statistics from _sql_stat1 and _sql_stat4 has been reworked to operate directly on Tarantool's structs. It also includes codestyle fixes. Nikita Pettik (4): sql: optimize compilation of SELECT COUNT(*) sql: add average tuple size calculation sql: refactor usages of table's tuple count sql: move SQL statistics to server src/box/index_def.c | 92 +++++ src/box/index_def.h | 90 +++++ src/box/sql/analyze.c | 787 ++++++++++++++++++++--------------------- src/box/sql/build.c | 107 ------ src/box/sql/parse.y | 2 - src/box/sql/pragma.c | 25 +- src/box/sql/prepare.c | 7 +- src/box/sql/select.c | 210 +++++------ src/box/sql/sqliteInt.h | 123 +++++-- src/box/sql/vdbe.c | 7 +- src/box/sql/where.c | 231 ++++++++---- src/box/sql/whereexpr.c | 4 +- test/sql-tap/analyze9.test.lua | 81 +++-- test/sql-tap/eqp.test.lua | 2 +- 14 files changed, 954 insertions(+), 814 deletions(-) -- 2.15.1