Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH 0/4] Move original SQLite's statistics to server
@ 2018-04-23 20:29 Nikita Pettik
  2018-04-23 20:29 ` [tarantool-patches] [PATCH 1/4] sql: optimize compilation of SELECT COUNT(*) Nikita Pettik
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Nikita Pettik @ 2018-04-23 20:29 UTC (permalink / raw)
  To: tarantool-patches; +Cc: v.shpilevoy, 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-05-15 13:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 20:29 [tarantool-patches] [PATCH 0/4] Move original SQLite's statistics to server Nikita Pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 1/4] sql: optimize compilation of SELECT COUNT(*) Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 2/4] sql: add average tuple size calculation Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 3/4] sql: refactor usages of table's tuple count Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-04-23 20:29 ` [tarantool-patches] [PATCH 4/4] sql: move SQL statistics to server Nikita Pettik
2018-04-24 12:51   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-11 17:29     ` n.pettik
2018-05-11 22:00       ` Vladislav Shpilevoy
2018-05-14 11:52         ` n.pettik
2018-05-14 12:54           ` Vladislav Shpilevoy
2018-05-14 13:55             ` n.pettik
2018-05-14 14:12 ` [tarantool-patches] Re: [PATCH 0/4] Move original SQLite's " Vladislav Shpilevoy
2018-05-15 13:42   ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox