/ Check-in [8a39167b]
Login

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

Overview
Comment:Futher improvements to LEFT JOIN strength reduction.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8a39167bd2d46496f7484cfec371e4bad22da882209b01da9459c4ed5877da25
User & Date: drh 2019-10-11 17:14:40
Context
2019-10-11
18:55
Update the zipfile extension to use deflateBound(), instead of compressBound(), to learn the maximum possible size of a deflate()d buffer. check-in: f5ee3042 user: dan tags: trunk
17:14
Futher improvements to LEFT JOIN strength reduction. check-in: 8a39167b user: drh tags: trunk
16:01
Improvements to the LEFT JOIN strength reduction optimization. check-in: 548082df user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  5230   5230   */
  5231   5231   int sqlite3ExprImpliesNonNullRow(Expr *p, int iTab){
  5232   5232     Walker w;
  5233   5233     p = sqlite3ExprSkipCollateAndLikely(p);
  5234   5234     if( p==0 ) return 0;
  5235   5235     if( p->op==TK_NOTNULL ){
  5236   5236       p = p->pLeft;
  5237         -  }else if( p->op==TK_AND ){
  5238         -    if( sqlite3ExprImpliesNonNullRow(p->pLeft, iTab) ) return 1;
  5239         -    p = p->pRight;
         5237  +  }else{
         5238  +    while( p->op==TK_AND ){
         5239  +      if( sqlite3ExprImpliesNonNullRow(p->pLeft, iTab) ) return 1;
         5240  +      p = p->pRight;
         5241  +    }
  5240   5242     }
  5241   5243     w.xExprCallback = impliesNotNullRow;
  5242   5244     w.xSelectCallback = 0;
  5243   5245     w.xSelectCallback2 = 0;
  5244   5246     w.eCode = 0;
  5245   5247     w.u.iCur = iTab;
  5246   5248     sqlite3WalkExpr(&w, p);