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 13A7126E9D for ; Mon, 30 Jul 2018 18:17:10 -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 e0ksti9pWdfN for ; Mon, 30 Jul 2018 18:17:09 -0400 (EDT) Received: from smtp2.mail.ru (smtp2.mail.ru [94.100.179.91]) (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 4795A23E7D for ; Mon, 30 Jul 2018 18:17:09 -0400 (EDT) Date: Tue, 31 Jul 2018 01:17:06 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH] sql: xfer optimization issue Message-ID: <20180730221705.u2fv3uraa2hnpisj@tkn_work_nb> References: <12B62C73-9BEC-49FA-B3FD-590C445CF25B@tarantool.org> <2123605D-8D6C-43A3-846F-735E4C2C7FC2@tarantool.org> <20180729011251.eitp7cisv6jv5opj@tkn_work_nb> <20180729151633.mnggrcl4jjnedhxf@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: Nikita Tatunov Cc: korablev@tarantool.org, tarantool-patches@freelists.org On Mon, Jul 30, 2018 at 09:33:55PM +0300, Nikita Tatunov wrote: > вс, 29 июл. 2018 г. в 18:16, Alexander Turenko > <[1]alexander.turenko@tarantool.org>: > > On Sun, Jul 29, 2018 at 02:23:30PM +0300, n.pettik wrote: > > > 1. Not actual due to 2, but it would be better to use > > > `pOp->p5 &= ~OPFLAG_XFER_OPT` to drop just that flag. > > > 2. It is counter-intuitive, IMHO, to change operation flags > during > > > that operation. So, said above, vote to move it to > OP_OpenWrite. > > > > Well, actually moving it to OP_OpenWrite seems to be bad idea. > > > > Even if code for xFer optimisation is generated, it > > > > still might not be executed. The only opcode ensuring xFer is > > > > under processing - OP_RowData. > We have separate OpenWrite opcodes in xfer and regular insert code. > We > open destination space curson always (to determine whether the space > is > empty), but we can set the flag when open source space cursor. But > this > will forbid to check source space for emptiness in xfer code or will > require to 'workaround' it using two cursors. > By the way, I observed that the following code is dead: > > if (emptySrcTest) > > sqlite3VdbeJumpHere(v, emptySrcTest); > WBR, Alexander Turenko. > > I'm not sured if changing p5 in OP_OpenWrite is a good idea since > 1) Even if p5 isn't used while xfer is processed it's reserved and > there are no free parameters. > 2) Who knows, probably we will need p5 for something in future. > 3) AFAIK OP_OpenWrite is a legacy opcode and probably gonna be > removed. > 4) For me it's more counter-intuitive to put incrementation in > opcode that barely related to xfer optimization idea. > 5) Do CPU cycles matter for debugging purpose only global variable? Ok. So, I think you need to comment in the opcode description that the flag is cleared after the first opcode execution. What with the rest of review from the two previous email from me? WBR, Alexander Turenko.