/ Check-in [38edc677]
Login

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

Overview
Comment:Small performance optimization in sqlite3WhereExprUsage().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | defer-where-subqueries
Files: files | file ages | folders
SHA3-256: 38edc6770e54e456500e77389d42fdf39e9a7ed258a4e1fed3c6dd8fdf4dfcb7
User & Date: drh 2017-07-10 15:26:09
Context
2017-07-10
16:38
Additional debugging Noop-comment in the constraint generator when wheretrace is enabled. Closed-Leaf check-in: 0ca7474f user: drh tags: defer-where-subqueries
15:26
Small performance optimization in sqlite3WhereExprUsage(). check-in: 38edc677 user: drh tags: defer-where-subqueries
15:17
Fix another problem on this branch. check-in: a4fc9811 user: dan tags: defer-where-subqueries
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/whereexpr.c.

  1380   1380     Bitmask mask;
  1381   1381     if( p==0 ) return 0;
  1382   1382     if( p->op==TK_COLUMN ){
  1383   1383       return sqlite3WhereGetMask(pMaskSet, p->iTable);
  1384   1384     }
  1385   1385     mask = (p->op==TK_IF_NULL_ROW) ? sqlite3WhereGetMask(pMaskSet, p->iTable) : 0;
  1386   1386     assert( !ExprHasProperty(p, EP_TokenOnly) );
  1387         -  if( p->pRight ) mask |= sqlite3WhereExprUsage(pMaskSet, p->pRight);
  1388   1387     if( p->pLeft ) mask |= sqlite3WhereExprUsage(pMaskSet, p->pLeft);
  1389         -  if( ExprHasProperty(p, EP_xIsSelect) ){
         1388  +  if( p->pRight ){
         1389  +    mask |= sqlite3WhereExprUsage(pMaskSet, p->pRight);
         1390  +    assert( p->x.pList==0 );
         1391  +  }else if( ExprHasProperty(p, EP_xIsSelect) ){
  1390   1392       if( ExprHasProperty(p, EP_VarSelect) ) pMaskSet->bVarSelect = 1;
  1391   1393       mask |= exprSelectUsage(pMaskSet, p->x.pSelect);
  1392   1394     }else if( p->x.pList ){
  1393   1395       mask |= sqlite3WhereExprListUsage(pMaskSet, p->x.pList);
  1394   1396     }
  1395   1397     return mask;
  1396   1398   }