/ Check-in [ab832336]
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:Make SQLite slightly more likely to use an auto-index within a sub-query.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ab832336f4a28193c4d2b61e833564822a7b86a8
User & Date: dan 2015-03-16 20:40:00
Context
2015-03-17
16:59
Transient locks in WAL mode can now block in order to resolve priority inversions. check-in: ec2f46de user: drh tags: trunk
2015-03-16
20:40
Make SQLite slightly more likely to use an auto-index within a sub-query. check-in: ab832336 user: dan tags: trunk
18:08
Fix typo of test prefix in the new WHERE test file. check-in: 34779c52 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  5997   5997       memset(aSortCost, 0, sizeof(LogEst) * nOrderBy);
  5998   5998     }
  5999   5999     assert( aSortCost==0 || &pSpace[nSpace]==(char*)&aSortCost[nOrderBy] );
  6000   6000     assert( aSortCost!=0 || &pSpace[nSpace]==(char*)pX );
  6001   6001   
  6002   6002     /* Seed the search with a single WherePath containing zero WhereLoops.
  6003   6003     **
  6004         -  ** TUNING: Do not let the number of iterations go above 25.  If the cost
  6005         -  ** of computing an automatic index is not paid back within the first 25
         6004  +  ** TUNING: Do not let the number of iterations go above 28.  If the cost
         6005  +  ** of computing an automatic index is not paid back within the first 28
  6006   6006     ** rows, then do not use the automatic index. */
  6007         -  aFrom[0].nRow = MIN(pParse->nQueryLoop, 46);  assert( 46==sqlite3LogEst(25) );
         6007  +  aFrom[0].nRow = MIN(pParse->nQueryLoop, 48);  assert( 48==sqlite3LogEst(28) );
  6008   6008     nFrom = 1;
  6009   6009     assert( aFrom[0].isOrdered==0 );
  6010   6010     if( nOrderBy ){
  6011   6011       /* If nLoop is zero, then there are no FROM terms in the query. Since
  6012   6012       ** in this case the query may return a maximum of one row, the results
  6013   6013       ** are already in the requested order. Set isOrdered to nOrderBy to
  6014   6014       ** indicate this. Or, if nLoop is greater than zero, set isOrdered to