/ Check-in [3e577f40]
Login

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

Overview
Comment:Change Noop-comments in where.c into Module-comments, so that they are omitting without SQLITE_ENABLE_MODULE_COMMENTS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3e577f40183c56e60866d8382b044688a1b77eaf
User & Date: drh 2013-11-19 12:33:23
Context
2013-11-19
13:55
Minor performance improvement to sqlite3SerialTypeGet(). check-in: 17e8524f user: drh tags: trunk
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
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  2752   2752     pLoop = pLevel->pWLoop;
  2753   2753     pTabItem = &pWInfo->pTabList->a[pLevel->iFrom];
  2754   2754     iCur = pTabItem->iCursor;
  2755   2755     pLevel->notReady = notReady & ~getMask(&pWInfo->sMaskSet, iCur);
  2756   2756     bRev = (pWInfo->revMask>>iLevel)&1;
  2757   2757     omitTable = (pLoop->wsFlags & WHERE_IDX_ONLY)!=0 
  2758   2758              && (pWInfo->wctrlFlags & WHERE_FORCE_TABLE)==0;
  2759         -  VdbeNoopComment((v, "Begin WHERE-loop%d: %s",iLevel,pTabItem->pTab->zName));
         2759  +  VdbeModuleComment((v, "Begin WHERE-loop%d: %s",iLevel,pTabItem->pTab->zName));
  2760   2760   
  2761   2761     /* Create labels for the "break" and "continue" instructions
  2762   2762     ** for the current loop.  Jump to addrBrk to break out of a loop.
  2763   2763     ** Jump to cont to go immediately to the next iteration of the
  2764   2764     ** loop.
  2765   2765     **
  2766   2766     ** When there is an IN operator, we also have a "addrNxt" label that
................................................................................
  3457   3457       assert( !ExprHasProperty(pE, EP_FromJoin) );
  3458   3458       assert( (pTerm->prereqRight & pLevel->notReady)!=0 );
  3459   3459       pAlt = findTerm(pWC, iCur, pTerm->u.leftColumn, notReady, WO_EQ|WO_IN, 0);
  3460   3460       if( pAlt==0 ) continue;
  3461   3461       if( pAlt->wtFlags & (TERM_CODED) ) continue;
  3462   3462       testcase( pAlt->eOperator & WO_EQ );
  3463   3463       testcase( pAlt->eOperator & WO_IN );
  3464         -    VdbeNoopComment((v, "begin transitive constraint"));
         3464  +    VdbeModuleComment((v, "begin transitive constraint"));
  3465   3465       pEAlt = sqlite3StackAllocRaw(db, sizeof(*pEAlt));
  3466   3466       if( pEAlt ){
  3467   3467         *pEAlt = *pAlt->pExpr;
  3468   3468         pEAlt->pLeft = pE->pLeft;
  3469   3469         sqlite3ExprIfFalse(pParse, pEAlt, addrCont, SQLITE_JUMPIFNULL);
  3470   3470         sqlite3StackFree(db, pEAlt);
  3471   3471       }
................................................................................
  5732   5732       explainOneScan(pParse, pTabList, pLevel, ii, pLevel->iFrom, wctrlFlags);
  5733   5733       pLevel->addrBody = sqlite3VdbeCurrentAddr(v);
  5734   5734       notReady = codeOneLoopStart(pWInfo, ii, notReady);
  5735   5735       pWInfo->iContinue = pLevel->addrCont;
  5736   5736     }
  5737   5737   
  5738   5738     /* Done. */
  5739         -  VdbeNoopComment((v, "Begin WHERE-core"));
         5739  +  VdbeModuleComment((v, "Begin WHERE-core"));
  5740   5740     return pWInfo;
  5741   5741   
  5742   5742     /* Jump here if malloc fails */
  5743   5743   whereBeginError:
  5744   5744     if( pWInfo ){
  5745   5745       pParse->nQueryLoop = pWInfo->savedNQueryLoop;
  5746   5746       whereInfoFree(db, pWInfo);
................................................................................
  5759   5759     WhereLevel *pLevel;
  5760   5760     WhereLoop *pLoop;
  5761   5761     SrcList *pTabList = pWInfo->pTabList;
  5762   5762     sqlite3 *db = pParse->db;
  5763   5763   
  5764   5764     /* Generate loop termination code.
  5765   5765     */
  5766         -  VdbeNoopComment((v, "End WHERE-core"));
         5766  +  VdbeModuleComment((v, "End WHERE-core"));
  5767   5767     sqlite3ExprCacheClear(pParse);
  5768   5768     for(i=pWInfo->nLevel-1; i>=0; i--){
  5769   5769       int addr;
  5770   5770       pLevel = &pWInfo->a[i];
  5771   5771       pLoop = pLevel->pWLoop;
  5772   5772       sqlite3VdbeResolveLabel(v, pLevel->addrCont);
  5773   5773       if( pLevel->op!=OP_Noop ){
................................................................................
  5805   5805         if( pLevel->op==OP_Return ){
  5806   5806           sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst);
  5807   5807         }else{
  5808   5808           sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrFirst);
  5809   5809         }
  5810   5810         sqlite3VdbeJumpHere(v, addr);
  5811   5811       }
  5812         -    VdbeNoopComment((v, "End WHERE-loop%d: %s", i,
         5812  +    VdbeModuleComment((v, "End WHERE-loop%d: %s", i,
  5813   5813                        pWInfo->pTabList->a[pLevel->iFrom].pTab->zName));
  5814   5814     }
  5815   5815   
  5816   5816     /* The "break" point is here, just past the end of the outer loop.
  5817   5817     ** Set it.
  5818   5818     */
  5819   5819     sqlite3VdbeResolveLabel(v, pWInfo->iBreak);