/ Check-in [fabb2185]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Do not use an index fullscan for an UPDATE or DELETE or if disabled by sqlite3_test_control() or sqlite3_config().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nextgen-query-plan-exp
Files: files | file ages | folders
SHA1: fabb21854e662b1d8e5631e79f828d5322ceb595
User & Date: drh 2013-06-03 19:17:40
Context
2013-06-03
20:46
Pull in recent trunk changes. Fix the ORDER BY optimizer so that it is better able to deal with COLLATE clauses. Clean up ambiguities in the descidx1.test script. check-in: 6bc71dfc user: drh tags: nextgen-query-plan-exp
19:17
Do not use an index fullscan for an UPDATE or DELETE or if disabled by sqlite3_test_control() or sqlite3_config(). check-in: fabb2185 user: drh tags: nextgen-query-plan-exp
19:01
Resolve ambiguities in test cases in collate2.test. check-in: dcbbcb2e user: drh tags: nextgen-query-plan-exp
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  4220   4220           if( x<BMS-1 ){
  4221   4221             m &= ~(((Bitmask)1)<<x);
  4222   4222           }
  4223   4223         }
  4224   4224         pNew->wsFlags = (m==0) ? (WHERE_IDX_ONLY|WHERE_INDEXED) : WHERE_INDEXED;
  4225   4225   
  4226   4226         /* Full scan via index */
  4227         -      if( (m==0 || b) && pProbe->bUnordered==0 ){
         4227  +      if( (m==0 || b)
         4228  +       && pProbe->bUnordered==0
         4229  +       && (pBuilder->pWC->wctrlFlags & WHERE_ONEPASS_DESIRED)==0
         4230  +       && sqlite3GlobalConfig.bUseCis
         4231  +       && OptimizationEnabled(pBuilder->pParse->db, SQLITE_CoverIdxScan)
         4232  +      ){
  4228   4233           pNew->iSortIdx = b ? iSortIdx : 0;
  4229   4234           pNew->nOut = rSize;
  4230   4235           pNew->rRun = (m==0) ? (rSize + rLogSize)*(1+b) : (rSize*rLogSize);
  4231   4236           rc = whereLoopInsert(pBuilder, pNew);
  4232   4237           if( rc ) break;
  4233   4238         }
  4234   4239       }