]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
An improved method for avoiding the use of the STAT3 samples to compute
authordrh <drh@noemail.net>
Thu, 1 Aug 2013 17:21:26 +0000 (17:21 +0000)
committerdrh <drh@noemail.net>
Thu, 1 Aug 2013 17:21:26 +0000 (17:21 +0000)
the estimated number of outputs when the left-most index is equality
constrained.  This check-in undoes the previous fix and applies a new one.

FossilOrigin-Name: 127a5b776d16e1e23c5b3d454f6aaea67f1ded3a

manifest
manifest.uuid
src/where.c

index 02972f03fab4c9f63e05f350667a53532343f7b0..199045ac76262c06f86867dcfac2310b72cb146a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Avoid\susing\sleft-most\scolumn\sSTAT3\ssamples\sif\sthe\sleft-most\scolumn\shas\san\nequality\sconstrain\sand\sthere\sare\sinequality\sconstraints\son\sthe\ssecond\scolumn.
-D 2013-08-01T16:52:50.320
+C An\simproved\smethod\sfor\savoiding\sthe\suse\sof\sthe\sSTAT3\ssamples\sto\scompute\nthe\sestimated\snumber\sof\soutputs\swhen\sthe\sleft-most\sindex\sis\sequality\nconstrained.\s\sThis\scheck-in\sundoes\sthe\sprevious\sfix\sand\sapplies\sa\snew\sone.
+D 2013-08-01T17:21:26.855
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -290,7 +290,7 @@ F src/vtab.c 2e8b489db47e20ae36cd247932dc671c9ded0624
 F src/wal.c 7dc3966ef98b74422267e7e6e46e07ff6c6eb1b4
 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
-F src/where.c fe1d056ffa4638fcdc22b4da1315b0ad98c3e872
+F src/where.c 38264830c393b0838c18b1f3dfc6c01471d1f70a
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
@@ -1103,7 +1103,7 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 136fc2931b156f91cdd76a7a009298cdf09d826a
-R 548b934e9d909f49470ebc18af6d5c19
+P 31b4e63b3c30fcad22340d84d6076a306f26b49e
+R 492afb1fab0455fbbeddb05926432910
 U drh
-Z e690d571856325e865e41cb4d68cbd8b
+Z f007f69644258ace0d976c8e46bfead9
index f30aafd4cd043e9d896a41dc5b6f969c38b4e48b..3ccbe102ca38523308497307dacf261bf39e1636 100644 (file)
@@ -1 +1 @@
-31b4e63b3c30fcad22340d84d6076a306f26b49e
\ No newline at end of file
+127a5b776d16e1e23c5b3d454f6aaea67f1ded3a
\ No newline at end of file
index 8a265a92887b64647ff591a2ad9c3f4128250017..ebdbfcf9feddd4c0d3788d2ef35d9af0c57ae3d5 100644 (file)
@@ -4420,7 +4420,7 @@ static int whereLoopAddBtreeIndex(
       pNew->nOut = saved_nOut>rDiv+10 ? saved_nOut - rDiv : 10;
     }
 #ifdef SQLITE_ENABLE_STAT3
-    if( pNew->u.btree.nEq==1 && pProbe->nSample && saved_nEq==0
+    if( pNew->u.btree.nEq==1 && pProbe->nSample
      &&  OptimizationEnabled(db, SQLITE_Stat3) ){
       tRowcnt nOut = 0;
       if( (pTerm->eOperator & (WO_EQ|WO_ISNULL))!=0 ){
@@ -4431,7 +4431,8 @@ static int whereLoopAddBtreeIndex(
              &&  !ExprHasProperty(pTerm->pExpr, EP_xIsSelect)  ){
         rc = whereInScanEst(pParse, pProbe, pTerm->pExpr->x.pList, &nOut);
       }
-      if( rc==SQLITE_OK ) pNew->nOut = whereCost(nOut);
+      assert( nOut==0 || rc==SQLITE_OK );
+      if( nOut ) pNew->nOut = whereCost(nOut);
     }
 #endif
     if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){