/ Check-in [83c0bb99]
Login

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

Overview
Comment:Lower the threshold for using skip-scan from 50 to 18, based on experiments that show that 18 is the approximate break-even point for a variety of schemas.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:83c0bb9913838d18ba355033afde6e38b4690842
User & Date: drh 2013-11-27 04:22:27
Context
2013-11-27
13:24
Make sure the colWidth array is correctly initialized in the ".explain" command of the shell. check-in: ceebcdca user: drh tags: trunk
04:22
Lower the threshold for using skip-scan from 50 to 18, based on experiments that show that 18 is the approximate break-even point for a variety of schemas. check-in: 83c0bb99 user: drh tags: trunk
04:00
Avoid using the GetVersionEx functions if they are considered deprecated. check-in: afdca299 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  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   3921   
  3922   3922     /* Consider using a skip-scan if there are no WHERE clause constraints
  3923   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.
         3924  +  ** number of repeats in the left-most terms is at least 18.  The magic
         3925  +  ** number 18 was found by experimentation to be the payoff point where
         3926  +  ** skip-scan become faster than a full-scan.
  3925   3927     */
  3926   3928     if( pTerm==0
  3927   3929      && saved_nEq==saved_nSkip
  3928   3930      && saved_nEq+1<pProbe->nKeyCol
  3929         -   && pProbe->aiRowEst[saved_nEq+1]>50  /* TUNING: Minimum for skip-scan */
         3931  +   && pProbe->aiRowEst[saved_nEq+1]>=18  /* TUNING: Minimum for skip-scan */
  3930   3932     ){
  3931   3933       LogEst nIter;
  3932   3934       pNew->u.btree.nEq++;
  3933   3935       pNew->u.btree.nSkip++;
  3934   3936       pNew->aLTerm[pNew->nLTerm++] = 0;
  3935   3937       pNew->wsFlags |= WHERE_SKIPSCAN;
  3936   3938       nIter = sqlite3LogEst(pProbe->aiRowEst[0]/pProbe->aiRowEst[saved_nEq+1]);