/ Check-in [57158d9d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid seeking on the main data table during the first loop of an UPDATE if an index is sufficient to check the WHERE clause.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 57158d9daf4d777411fffb1c1d20d89b291d9214
User & Date: drh 2013-11-19 02:34:11
Context
2013-11-19
12:33
Change Noop-comments in where.c into Module-comments, so that they are omitting without SQLITE_ENABLE_MODULE_COMMENTS. check-in: 3e577f40 user: drh tags: trunk
02:34
Avoid seeking on the main data table during the first loop of an UPDATE if an index is sufficient to check the WHERE clause. check-in: 57158d9d user: drh tags: trunk
00:31
Fix an requirement mark in a test script so that it matches the typo-corrected requirement. No changes to code. check-in: 072412d5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/update.c.

   258    258       }
   259    259   #endif
   260    260     }
   261    261     assert( (chngRowid & chngPk)==0 );
   262    262     assert( chngRowid==0 || chngRowid==1 );
   263    263     assert( chngPk==0 || chngPk==1 );
   264    264     chngKey = chngRowid + chngPk;
          265  +
          266  +  /* The SET expressions are not actually used inside the WHERE loop.
          267  +  ** So reset the colUsed mask
          268  +  */
          269  +  pTabList->a[0].colUsed = 0;
   265    270   
   266    271     hasFK = sqlite3FkRequired(pParse, pTab, aXRef, chngKey);
   267    272   
   268    273     /* There is one entry in the aRegIdx[] array for each index on the table
   269    274     ** being updated.  Fill in aRegIdx[] with a register number that will hold
   270    275     ** the key for accessing each index.  
   271    276     */