/ Check-in [e9df04ce]
Login

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

Overview
Comment:Add comments identifing where the skip-scan option is decided in the query planner, to aid in tuning that decision. No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e9df04cec48bb8b4ea26ec9024a22ea42b2338eb
User & Date: drh 2013-11-18 19:32:15
Context
2013-11-19
00:31
Fix an requirement mark in a test script so that it matches the typo-corrected requirement. No changes to code. check-in: 072412d5 user: drh tags: trunk
2013-11-18
19:32
Add comments identifing where the skip-scan option is decided in the query planner, to aid in tuning that decision. No changes to code. check-in: e9df04ce user: drh tags: trunk
18:48
Fix documentation typos. No changes to code. check-in: 7caeb09c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  3914   3914     saved_nSkip = pNew->u.btree.nSkip;
  3915   3915     saved_nLTerm = pNew->nLTerm;
  3916   3916     saved_wsFlags = pNew->wsFlags;
  3917   3917     saved_prereq = pNew->prereq;
  3918   3918     saved_nOut = pNew->nOut;
  3919   3919     pNew->rSetup = 0;
  3920   3920     rLogSize = estLog(sqlite3LogEst(pProbe->aiRowEst[0]));
         3921  +
         3922  +  /* Consider using a skip-scan if there are no WHERE clause constraints
         3923  +  ** available for the left-most terms of the index, and if the average
         3924  +  ** number of repeats in the left-most terms is at least 50.
         3925  +  */
  3921   3926     if( pTerm==0
  3922   3927      && saved_nEq==saved_nSkip
  3923   3928      && saved_nEq+1<pProbe->nKeyCol
  3924         -   && pProbe->aiRowEst[saved_nEq+1]>50
         3929  +   && pProbe->aiRowEst[saved_nEq+1]>50  /* TUNING: Minimum for skip-scan */
  3925   3930     ){
  3926   3931       LogEst nIter;
  3927   3932       pNew->u.btree.nEq++;
  3928   3933       pNew->u.btree.nSkip++;
  3929   3934       pNew->aLTerm[pNew->nLTerm++] = 0;
  3930   3935       pNew->wsFlags |= WHERE_SKIPSCAN;
  3931   3936       nIter = sqlite3LogEst(pProbe->aiRowEst[0]/pProbe->aiRowEst[saved_nEq+1]);