diff options
author | drh <drh@noemail.net> | 2014-01-03 16:03:43 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-01-03 16:03:43 +0000 |
commit | 5426d80948c18c9dda289aa92f48328003e36193 (patch) | |
tree | 6306ea27e1f8ad6b521781a3bad65079d9e8d155 /src | |
parent | 759e8588117ef04a0ef331b0128e2a684049f00c (diff) | |
download | sqlite-5426d80948c18c9dda289aa92f48328003e36193.tar.gz sqlite-5426d80948c18c9dda289aa92f48328003e36193.zip |
Avoid some unnecessary OP_SCopy operations when inserting into a table
with multiple indices.
FossilOrigin-Name: 429018b19cb525a4bb0843d20955457b53900d4b
Diffstat (limited to 'src')
-rw-r--r-- | src/insert.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/insert.c b/src/insert.c index b3b8444f3..abc34c03c 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1233,6 +1233,7 @@ void sqlite3GenerateConstraintChecks( int ipkTop = 0; /* Top of the rowid change constraint check */ int ipkBottom = 0; /* Bottom of the rowid change constraint check */ u8 isUpdate; /* True if this is an UPDATE operation */ + int regRowid = -1; /* Register holding ROWID value */ isUpdate = regOldData!=0; db = pParse->db; @@ -1463,7 +1464,9 @@ void sqlite3GenerateConstraintChecks( int iField = pIdx->aiColumn[i]; int x; if( iField<0 || iField==pTab->iPKey ){ + if( regRowid==regIdx+i ) continue; /* ROWID already in regIdx+i */ x = regNewData; + regRowid = pIdx->pPartIdxWhere ? -1 : regIdx+i; }else{ x = iField + regNewData + 1; } |