[tarantool-patches] Re: [tarantool-patches] [PATCH] sql: remove unnecessary MakeRecord opcodes

Bulat Niatshin niatshin at tarantool.org
Wed Apr 4 15:42:34 MSK 2018


I am sorry, I forgot to specify branch name and ticket.

Branch:
https://github.com/tarantool/tarantool/tree/bn/gh-3317-remove-makerecord  
Issue:
https://github.com/tarantool/tarantool/issues/3317


>Среда,  4 апреля 2018, 15:38 +03:00 от Bulat Niatshin <niatshin at tarantool.org>:
>
>OP_MakeRecord creates a record from a given range of registers
>and stores that record in a specified register. But now even
>secondary indexes with non-default ON CONFLICT clause doesn't
>need it, it is necessary only for primary key indexes. However
>that unnecesary opcodes appear in INSERT listings. This patch
>contains a fix for that.
>
>Closes #3317
>---
> src/box/sql/insert.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
>diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
>index 4a57b23f5..701fae412 100644
>--- a/src/box/sql/insert.c
>+++ b/src/box/sql/insert.c
>@@ -1309,18 +1309,10 @@ sqlite3GenerateConstraintChecks(Parse * pParse,		/* The parser context */
> 					sqlite3VdbeResolveLabel(v, skip_if_null);
> 				}
> 			}
>-			if (IsPrimaryKeyIndex(pIdx) || uniqueByteCodeNeeded) {
>-				sqlite3VdbeAddOp3(v, OP_MakeRecord, regNewData + 1,
>-						  pTab->nCol, aRegIdx[ix]);
>-				VdbeComment((v, "for %s", pIdx->zName));
>-			}
>-		} else {
>-			/* kyukhin: for Tarantool, this should be evaluated to NOP.  */
>-			if (IsPrimaryKeyIndex(pIdx) || uniqueByteCodeNeeded) {
>-				sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx,
>-						  nIdxCol, aRegIdx[ix]);
>-				VdbeComment((v, "for %s", pIdx->zName));
>-			}
>+
>+			sqlite3VdbeAddOp3(v, OP_MakeRecord, regNewData + 1,
>+					pTab->nCol, aRegIdx[ix]);
>+			VdbeComment((v, "for %s", pIdx->zName));
> 		}
> 
> 		/* In an UPDATE operation, if this index is the PRIMARY KEY
>-- 
>2.14.1
>
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20180404/3a2aed3d/attachment.html>


More information about the Tarantool-patches mailing list