1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Avoid seeking on the main data table during the first loop of an UPDATE

if an index is sufficient to check the WHERE clause.

FossilOrigin-Name: 57158d9daf4d777411fffb1c1d20d89b291d9214
This commit is contained in:
drh
2013-11-19 02:34:11 +00:00
parent f37139f65b
commit 5c82f4df9f
3 changed files with 12 additions and 7 deletions

View File

@@ -263,6 +263,11 @@ void sqlite3Update(
assert( chngPk==0 || chngPk==1 );
chngKey = chngRowid + chngPk;
/* The SET expressions are not actually used inside the WHERE loop.
** So reset the colUsed mask
*/
pTabList->a[0].colUsed = 0;
hasFK = sqlite3FkRequired(pParse, pTab, aXRef, chngKey);
/* There is one entry in the aRegIdx[] array for each index on the table