/ Check-in [6ba60952]
Login

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

Overview
Comment:Add a testcase() macro to help verfity the row estimation logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | stat4-experimental
Files: files | file ages | folders
SHA1: 6ba609522ea7325341fad93bdb5f869c6506dea4
User & Date: drh 2014-08-28 17:20:37
Context
2014-08-28
17:30
Fix a problem causing an inaccurate stat4-based estimate for the number of rows visited by a range scan. check-in: a9daf3ac user: drh tags: trunk
17:20
Add a testcase() macro to help verfity the row estimation logic. Closed-Leaf check-in: 6ba60952 user: drh tags: stat4-experimental
16:01
Fix a problem causing an inaccurate stat4-based estimate for the number of rows visited by a range scan. check-in: 052d89b5 user: dan tags: stat4-experimental
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/where.c.

2187
2188
2189
2190
2191
2192
2193


2194

2195
2196
2197
2198
2199
2200
2201
      ** less than the upper bound of the range query. Where the upper bound
      ** is either ($P) or ($P:$U). Again, even if $U is available, both values
      ** of iUpper are requested of whereKeyStats() and the smaller used.
      */
      tRowcnt iLower;
      tRowcnt iUpper;



      if( pRec ) pRec->nField = pBuilder->nRecValid;

      if( nEq==p->nKeyCol ){
        aff = SQLITE_AFF_INTEGER;
      }else{
        aff = p->pTable->aCol[p->aiColumn[nEq]].affinity;
      }
      /* Determine iLower and iUpper using ($P) only. */
      if( nEq==0 ){







>
>
|
>







2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
      ** less than the upper bound of the range query. Where the upper bound
      ** is either ($P) or ($P:$U). Again, even if $U is available, both values
      ** of iUpper are requested of whereKeyStats() and the smaller used.
      */
      tRowcnt iLower;
      tRowcnt iUpper;

      if( pRec ){
        testcase( pRec->nField!=pBuilder->nRecValid );
        pRec->nField = pBuilder->nRecValid;
      }
      if( nEq==p->nKeyCol ){
        aff = SQLITE_AFF_INTEGER;
      }else{
        aff = p->pTable->aCol[p->aiColumn[nEq]].affinity;
      }
      /* Determine iLower and iUpper using ($P) only. */
      if( nEq==0 ){