diff options
author | drh <drh@noemail.net> | 2016-10-03 01:21:51 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-10-03 01:21:51 +0000 |
commit | cb43a937e57113a21ee0b2ef52a532073c8d3a2d (patch) | |
tree | 71d34aeef018ea126e78b2eab4ca89b7115d055d /src/wherecode.c | |
parent | 1a7df58c1aae72f73c183ec7a48a19d773177ccb (diff) | |
download | sqlite-cb43a937e57113a21ee0b2ef52a532073c8d3a2d.tar.gz sqlite-cb43a937e57113a21ee0b2ef52a532073c8d3a2d.zip |
Allocate Parse objects off of the stack where appropriate for a substantial
performance increase and a size reduction.
FossilOrigin-Name: ea8affa9e453b201b479162f621b591e7a65a489
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 0948dce4e..ec21e0bf6 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1987,7 +1987,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( ** the implied "t1.a=123" constraint. */ for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ - Expr *pE, *pEAlt; + Expr *pE, sEAlt; WhereTerm *pAlt; if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue; @@ -2005,13 +2005,9 @@ Bitmask sqlite3WhereCodeOneLoopStart( testcase( pAlt->eOperator & WO_IS ); testcase( pAlt->eOperator & WO_IN ); VdbeModuleComment((v, "begin transitive constraint")); - pEAlt = sqlite3StackAllocRaw(db, sizeof(*pEAlt)); - if( pEAlt ){ - *pEAlt = *pAlt->pExpr; - pEAlt->pLeft = pE->pLeft; - sqlite3ExprIfFalse(pParse, pEAlt, addrCont, SQLITE_JUMPIFNULL); - sqlite3StackFree(db, pEAlt); - } + sEAlt = *pAlt->pExpr; + sEAlt.pLeft = pE->pLeft; + sqlite3ExprIfFalse(pParse, &sEAlt, addrCont, SQLITE_JUMPIFNULL); } /* For a LEFT OUTER JOIN, generate code that will record the fact that |