/ Check-in [c1a1d68c]
Login

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

Overview
Comment:More aggressive use of EP_Leaf on expression nodes, to help prune searches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c1a1d68c8219c8072e60af5c46a30849ae9a04fa1a6b2a8b22b82fec069d691d
User & Date: drh 2017-07-07 12:43:57
Context
2017-07-07
12:58
More efficient and compact implementation of walkExpr(). check-in: 115d4b83 user: drh tags: trunk
12:43
More aggressive use of EP_Leaf on expression nodes, to help prune searches. check-in: c1a1d68c user: drh tags: trunk
11:49
Very slightly smaller and faster sqlite3WalkSelect(). check-in: 9bc65635 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

   740    740     pNew = sqlite3DbMallocRawNN(db, sizeof(Expr)+nExtra);
   741    741     if( pNew ){
   742    742       memset(pNew, 0, sizeof(Expr));
   743    743       pNew->op = (u8)op;
   744    744       pNew->iAgg = -1;
   745    745       if( pToken ){
   746    746         if( nExtra==0 ){
   747         -        pNew->flags |= EP_IntValue;
          747  +        pNew->flags |= EP_IntValue|EP_Leaf;
   748    748           pNew->u.iValue = iValue;
   749    749         }else{
   750    750           pNew->u.zToken = (char*)&pNew[1];
   751    751           assert( pToken->z!=0 || pToken->n==0 );
   752    752           if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n);
   753    753           pNew->u.zToken[pToken->n] = 0;
   754    754           if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){

Changes to src/resolve.c.

   474    474     /* Clean up and return
   475    475     */
   476    476     sqlite3ExprDelete(db, pExpr->pLeft);
   477    477     pExpr->pLeft = 0;
   478    478     sqlite3ExprDelete(db, pExpr->pRight);
   479    479     pExpr->pRight = 0;
   480    480     pExpr->op = (isTrigger ? TK_TRIGGER : TK_COLUMN);
          481  +  ExprSetProperty(pExpr, EP_Leaf);
   481    482   lookupname_end:
   482    483     if( cnt==1 ){
   483    484       assert( pNC!=0 );
   484    485       if( !ExprHasProperty(pExpr, EP_Alias) ){
   485    486         sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
   486    487       }
   487    488       /* Increment the nRef value on all name contexts from TopNC up to