/ Check-in [4e725f53]
Login

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

Overview
Comment:Improvements to the column-cache for nested AND/OR operators.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4e725f53131d3584319c710c8710a068989543c6
User & Date: drh 2014-01-04 15:17:04
Context
2014-01-04
16:49
Omit OP_Close operations that occur immediately prior to OP_Halt and which cannot be jumped over. check-in: 874b7e99 user: drh tags: trunk
15:17
Improvements to the column-cache for nested AND/OR operators. check-in: 4e725f53 user: drh tags: trunk
14:46
Have FTS assign extremely high costs to plans that feature unusable MATCH constraints. This discourages the planner from choosing such plans, which lead to "unable to use function MATCH in the requested context" errors. check-in: fa8be488 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  3384   3384       sqlite3ExplainExpr(pOut, pList->a[0].pExpr);
  3385   3385     }else{
  3386   3386       sqlite3ExplainPush(pOut);
  3387   3387       for(i=0; i<pList->nExpr; i++){
  3388   3388         sqlite3ExplainPrintf(pOut, "item[%d] = ", i);
  3389   3389         sqlite3ExplainPush(pOut);
  3390   3390         sqlite3ExplainExpr(pOut, pList->a[i].pExpr);
  3391         -      sqlite3ExplainPop(pOut);
         3391  +      sqlite3ExplainPop(pOut, 1);
  3392   3392         if( pList->a[i].zName ){
  3393   3393           sqlite3ExplainPrintf(pOut, " AS %s", pList->a[i].zName);
  3394   3394         }
  3395   3395         if( pList->a[i].bSpanIsTab ){
  3396   3396           sqlite3ExplainPrintf(pOut, " (%s)", pList->a[i].zSpan);
  3397   3397         }
  3398   3398         if( i<pList->nExpr-1 ){
................................................................................
  3534   3534     if( NEVER(v==0) )     return;  /* Existence of VDBE checked by caller */
  3535   3535     if( NEVER(pExpr==0) ) return;  /* No way this can happen */
  3536   3536     op = pExpr->op;
  3537   3537     switch( op ){
  3538   3538       case TK_AND: {
  3539   3539         int d2 = sqlite3VdbeMakeLabel(v);
  3540   3540         testcase( jumpIfNull==0 );
  3541         -      sqlite3ExprCachePush(pParse);
  3542   3541         sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2,jumpIfNull^SQLITE_JUMPIFNULL);
         3542  +      sqlite3ExprCachePush(pParse);
  3543   3543         sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull);
  3544   3544         sqlite3VdbeResolveLabel(v, d2);
  3545   3545         sqlite3ExprCachePop(pParse, 1);
  3546   3546         break;
  3547   3547       }
  3548   3548       case TK_OR: {
  3549   3549         testcase( jumpIfNull==0 );
  3550   3550         sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull);
         3551  +      sqlite3ExprCachePush(pParse);
  3551   3552         sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull);
         3553  +      sqlite3ExprCachePop(pParse, 1);
  3552   3554         break;
  3553   3555       }
  3554   3556       case TK_NOT: {
  3555   3557         testcase( jumpIfNull==0 );
  3556   3558         sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull);
  3557   3559         break;
  3558   3560       }
................................................................................
  3691   3693     assert( pExpr->op!=TK_GT || op==OP_Le );
  3692   3694     assert( pExpr->op!=TK_GE || op==OP_Lt );
  3693   3695   
  3694   3696     switch( pExpr->op ){
  3695   3697       case TK_AND: {
  3696   3698         testcase( jumpIfNull==0 );
  3697   3699         sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull);
         3700  +      sqlite3ExprCachePush(pParse);
  3698   3701         sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull);
         3702  +      sqlite3ExprCachePop(pParse, 1);
  3699   3703         break;
  3700   3704       }
  3701   3705       case TK_OR: {
  3702   3706         int d2 = sqlite3VdbeMakeLabel(v);
  3703   3707         testcase( jumpIfNull==0 );
  3704         -      sqlite3ExprCachePush(pParse);
  3705   3708         sqlite3ExprIfTrue(pParse, pExpr->pLeft, d2, jumpIfNull^SQLITE_JUMPIFNULL);
         3709  +      sqlite3ExprCachePush(pParse);
  3706   3710         sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull);
  3707   3711         sqlite3VdbeResolveLabel(v, d2);
  3708   3712         sqlite3ExprCachePop(pParse, 1);
  3709   3713         break;
  3710   3714       }
  3711   3715       case TK_NOT: {
  3712   3716         testcase( jumpIfNull==0 );