Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Avoid unnecessary WHERE clause term tests when coding a join where one of the tables contains a OR constraint. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | OR-clause-improvement |
Files: | files | file ages | folders |
SHA1: |
ab94603974a0ad5342e5aee276031626 |
User & Date: | drh 2016-01-29 16:57:06.008 |
Context
2016-01-29
| ||
18:11 | Avoid unnecessary WHERE clause term tests when coding a join where one of the tables contains a OR constraint. (check-in: 512caa1ad3 user: drh tags: trunk) | |
16:57 | Avoid unnecessary WHERE clause term tests when coding a join where one of the tables contains a OR constraint. (Closed-Leaf check-in: ab94603974 user: drh tags: OR-clause-improvement) | |
08:38 | Avoid two more instances of pointer arithmetic on freed pointers. (check-in: 2910ef6409 user: dan tags: trunk) | |
Changes
Changes to src/wherecode.c.
︙ | ︙ | |||
1397 1398 1399 1400 1401 1402 1403 | */ if( pWC->nTerm>1 ){ int iTerm; for(iTerm=0; iTerm<pWC->nTerm; iTerm++){ Expr *pExpr = pWC->a[iTerm].pExpr; if( &pWC->a[iTerm] == pTerm ) continue; if( ExprHasProperty(pExpr, EP_FromJoin) ) continue; | | > > | 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 | */ if( pWC->nTerm>1 ){ int iTerm; for(iTerm=0; iTerm<pWC->nTerm; iTerm++){ Expr *pExpr = pWC->a[iTerm].pExpr; if( &pWC->a[iTerm] == pTerm ) continue; if( ExprHasProperty(pExpr, EP_FromJoin) ) continue; testcase( pWC->a[iTerm].wtFlags & TERM_VIRTUAL ); testcase( pWC->a[iTerm].wtFlags & TERM_CODED ); if( (pWC->a[iTerm].wtFlags & (TERM_VIRTUAL|TERM_CODED))!=0 ) continue; if( (pWC->a[iTerm].eOperator & WO_ALL)==0 ) continue; testcase( pWC->a[iTerm].wtFlags & TERM_ORINFO ); pExpr = sqlite3ExprDup(db, pExpr, 0); pAndExpr = sqlite3ExprAnd(db, pAndExpr, pExpr); } if( pAndExpr ){ pAndExpr = sqlite3PExpr(pParse, TK_AND|TKFLG_DONTFOLD, 0, pAndExpr, 0); |
︙ | ︙ |