/ Check-in [1cbe7a08]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Remove the WHERE_LIKELIHOOD bit, as it does not seem to effect any result.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1cbe7a0883e081611a50524517d70e0b6c5199d2
User & Date: drh 2014-06-02 21:00:34
References
2014-06-03
11:32
Add a test to double-check that [1cbe7a0883] did not affect anything. check-in: c6b512a7 user: dan tags: trunk
Context
2014-06-03
11:32
Add a test to double-check that [1cbe7a0883] did not affect anything. check-in: c6b512a7 user: dan tags: trunk
2014-06-02
21:00
Remove the WHERE_LIKELIHOOD bit, as it does not seem to effect any result. check-in: 1cbe7a08 user: drh tags: trunk
18:24
Fix a typo in a requirements mark comment in a test script. No changes to code. check-in: 75ff459b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  4282   4282   
  4283   4283         assert( pNew->nOut==saved_nOut );
  4284   4284         if( pTerm->truthProb<=0 && iCol>=0 ){
  4285   4285           assert( (eOp & WO_IN) || nIn==0 );
  4286   4286           testcase( eOp & WO_IN );
  4287   4287           pNew->nOut += pTerm->truthProb;
  4288   4288           pNew->nOut -= nIn;
  4289         -        pNew->wsFlags |= WHERE_LIKELIHOOD;
  4290   4289         }else{
  4291   4290   #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  4292   4291           tRowcnt nOut = 0;
  4293   4292           if( nInMul==0 
  4294   4293            && pProbe->nSample 
  4295   4294            && pNew->u.btree.nEq<=pProbe->nSampleCol
  4296   4295            && OptimizationEnabled(db, SQLITE_Stat3) 
  4297   4296            && ((eOp & WO_IN)==0 || !ExprHasProperty(pTerm->pExpr, EP_xIsSelect))
  4298         -         && (pNew->wsFlags & WHERE_LIKELIHOOD)==0
  4299   4297           ){
  4300   4298             Expr *pExpr = pTerm->pExpr;
  4301   4299             if( (eOp & (WO_EQ|WO_ISNULL))!=0 ){
  4302   4300               testcase( eOp & WO_EQ );
  4303   4301               testcase( eOp & WO_ISNULL );
  4304   4302               rc = whereEqualScanEst(pParse, pBuilder, pExpr->pRight, &nOut);
  4305   4303             }else{

Changes to src/whereInt.h.

   454    454   #define WHERE_VIRTUALTABLE 0x00000400  /* WhereLoop.u.vtab is valid */
   455    455   #define WHERE_IN_ABLE      0x00000800  /* Able to support an IN operator */
   456    456   #define WHERE_ONEROW       0x00001000  /* Selects no more than one row */
   457    457   #define WHERE_MULTI_OR     0x00002000  /* OR using multiple indices */
   458    458   #define WHERE_AUTO_INDEX   0x00004000  /* Uses an ephemeral index */
   459    459   #define WHERE_SKIPSCAN     0x00008000  /* Uses the skip-scan algorithm */
   460    460   #define WHERE_UNQ_WANTED   0x00010000  /* WHERE_ONEROW would have been helpful*/
   461         -#define WHERE_LIKELIHOOD   0x00020000  /* A likelihood() is affecting nOut */