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 622112C2E0 for ; Tue, 27 Mar 2018 12:28:30 -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 wDf8gDn5qHlT for ; Tue, 27 Mar 2018 12:28:30 -0400 (EDT) Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 CC7052C2CD for ; Tue, 27 Mar 2018 12:28:29 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [tarantool-patches] Re: [PATCH 0/4] Replace space id with space ptrs in VDBE runtime From: "n.pettik" In-Reply-To: Date: Tue, 27 Mar 2018 19:28:27 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <70082E76-4898-464C-B01C-A17638F0950C@tarantool.org> References: 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: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org > On 24 Mar 2018, at 15:37, v.shpilevoy@tarantool.org wrote: >=20 > See my commits with the final review fixes on you branch (you can = squash them, or not - on your choice). >=20 > And please fix failing tests on commit "sql: introduce opcodes to = operate on system spaces=E2=80=9D. Ok, thanks. I have squashed your fixes and make that commit pass tests. >=20 >> 21 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2018 =D0=B3., =D0=B2 2:48, Nikita = Pettik =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB= (=D0=B0): >>=20 >> Branch: = https://github.com/tarantool/tarantool/tree/np/gh-3252-slit-dml-and-ddl-sq= l >> Issue: https://github.com/tarantool/tarantool/issues/3252 >>=20 >> In order to avoid additional lookups during VDBE execution, >> it was suggested to pass pointer fetched at query compilation time to >> opcodes which create cursors (i.e. OP_OpenRead and OP_OpenWrite). >> However, any DDL routine may invalidate pointers. Thus, to operate on >> system spaces (which are used during DDL) new opcodes have been = introduced: >> OP_SInsert and OP_SDelete. But originally, SQL DDL under hood used = nested >> parsing to generate code for non-trivial deletion. For instance: >> "DELETE FROM _INDEX WHERE id =3D space_id AND iid > 0" -- to remove = all >> secondary indexes. To use new operands such nested parsing has been >> substituted with hardcoded VDBE programs. >> Finally, fresh pointer to space can also be obtained at VDBE rutime = using >> new opcode OP_SIDtoPtr, which converts space id to ptr and saves it = to >> given register. This opcode should be used when it is impossible to = avoid >> mixing DDL and DML routine in the same query >> (e.g. CREATE TABLE AS SELECT FROM ...). >>=20 >> Nikita Pettik (4): >> sql: pass space pointer to OP_OpenRead/OpenWrite >> sql: introduce opcodes to operate on system spaces >> sql: rework code generation for DDL routine >> sql: rework OP_OpenWrite/OpenRead >>=20 >> src/box/sql.c | 51 ++++--- >> src/box/sql/analyze.c | 17 ++- >> src/box/sql/build.c | 321 = ++++++++++++++++++++++--------------------- >> src/box/sql/expr.c | 14 +- >> src/box/sql/fkey.c | 11 +- >> src/box/sql/insert.c | 37 ++++- >> src/box/sql/opcodes.c | 51 +++---- >> src/box/sql/opcodes.h | 59 ++++---- >> src/box/sql/select.c | 11 +- >> src/box/sql/sqliteInt.h | 5 + >> src/box/sql/tarantoolInt.h | 11 +- >> src/box/sql/trigger.c | 27 ++-- >> src/box/sql/vdbe.c | 310 = +++++++++++++++++++++-------------------- >> src/box/sql/vdbe.h | 1 + >> src/box/sql/vdbeInt.h | 1 + >> src/box/sql/vdbeaux.c | 13 ++ >> src/box/sql/where.c | 12 +- >> test/sql/transition.result | 11 +- >> test/sql/transition.test.lua | 8 +- >> 19 files changed, 550 insertions(+), 421 deletions(-) >>=20 >> --=20 >> 2.15.1 >>=20 >>=20 >=20 >=20