/ Check-in [de08a7e7]
Login

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

Overview
Comment:Avoid unnecessary OP_IfNull checks when doing a range query where there is a constraint on the lower bound of the range.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: de08a7e7abbad9b94d0268d096ef4555d31c8b0c
User & Date: drh 2013-11-16 14:03:53
Context
2013-11-16
15:35
Fully constraint the ORDER BY on the top-10 line of the --summary output from the wordcount test program. Add the run-wordcount.bash script for running wordcount in various configurations. check-in: 7edf39eb user: drh tags: trunk
14:03
Avoid unnecessary OP_IfNull checks when doing a range query where there is a constraint on the lower bound of the range. check-in: de08a7e7 user: drh tags: trunk
13:55
Simplification and performance improvement to the logic that factors constant expressions ouf of inner loops. check-in: ee9353fd user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  3139   3139       */
  3140   3140       r1 = sqlite3GetTempReg(pParse);
  3141   3141       testcase( pLoop->wsFlags & WHERE_BTM_LIMIT );
  3142   3142       testcase( pLoop->wsFlags & WHERE_TOP_LIMIT );
  3143   3143       if( (pLoop->wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0 
  3144   3144        && (j = pIdx->aiColumn[nEq])>=0 
  3145   3145        && pIdx->pTable->aCol[j].notNull==0 
         3146  +     && (nEq || (pLoop->wsFlags & WHERE_BTM_LIMIT)==0)
  3146   3147       ){
  3147   3148         sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, nEq, r1);
  3148   3149         VdbeComment((v, "%s", pIdx->pTable->aCol[j].zName));
  3149   3150         sqlite3VdbeAddOp2(v, OP_IsNull, r1, addrCont);
  3150   3151       }
  3151   3152       sqlite3ReleaseTempReg(pParse, r1);
  3152   3153