[PATCH 0/2] schema: expose space_mt and index_mt on box.schema table

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Apr 1 14:02:44 MSK 2018

Branch: http://github.com/tarantool/tarantool/tree/pr-3204-expose-space-index-mt
Issue: https://github.com/tarantool/tarantool/issues/3204

Space_mt and index_mt are created individually for each space
inside a giant space.bless function. It consumes lua memory by
duplicating these metatables (which is very limited), and does not
allow to add new functions, which would be visible in all spaces
and indexes.

Lets move space_mt and index_mt definitions out of space.bless
function in box.schema.space/index_mt, and allow to expand them
with user functions.

Vladislav Shpilevoy (2):
  schema: move space_mt and index_mt definition out of space bless
  schema: expose space_mt and index_mt on `box.schema` table

 src/box/lua/schema.lua          | 636 ++++++++++++++++++++--------------------
 test/box-tap/schema_mt.test.lua |  79 +++++
 2 files changed, 404 insertions(+), 311 deletions(-)
 create mode 100755 test/box-tap/schema_mt.test.lua

2.14.3 (Apple Git-98)

More information about the Tarantool-patches mailing list