]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Minor performance tuning of the NGQP.
authordrh <drh@noemail.net>
Wed, 5 Jun 2013 16:19:59 +0000 (16:19 +0000)
committerdrh <drh@noemail.net>
Wed, 5 Jun 2013 16:19:59 +0000 (16:19 +0000)
FossilOrigin-Name: cbef38c2d123e7d5a02c2a2450e8b329e3e96ee9

manifest
manifest.uuid
src/where.c

index ae6211e19d9ed8470b74c6e0c1e474e880fff7c2..454d643033706e23e53398dcdb4f09285ea63ef1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Performance\stweak\sto\swhereLoopInsert().
-D 2013-06-05T12:47:59.358
+C Minor\sperformance\stuning\sof\sthe\sNGQP.
+D 2013-06-05T16:19:59.536
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -289,7 +289,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83
 F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
-F src/where.c 3b175d731c15e30bd8893b0309f9e7e8d0f11121
+F src/where.c 7d8a020b2d60ff2b536e6325af18ed11c24f81e5
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
@@ -1094,7 +1094,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 96afe50866a08ed14e911c3c955030f7ab83a3ed
-R 70441548922262718992448fc2500d0d
+P 1c4a78807b7a28c9976ca8c5722ff4e2e8755b7e
+R 4c15e208b04c5a33c6528133849a04db
 U drh
-Z 415f390706a3e5c8723b2ce592b50c3b
+Z c639596f7b6bcfbd4cf032fe7e7c5fd1
index ce1f9dfb25c9b0e92725841c67735486079193a8..2673f095711dd3ffe1600ecaaaa4ce05fc169b42 100644 (file)
@@ -1 +1 @@
-1c4a78807b7a28c9976ca8c5722ff4e2e8755b7e
\ No newline at end of file
+cbef38c2d123e7d5a02c2a2450e8b329e3e96ee9
\ No newline at end of file
index 3af73198e853e4a9404cf2ea96ee63562df9cf6b..4229ddc7ec83408c5334debb05ffcbad2906b7ea 100644 (file)
@@ -752,7 +752,8 @@ WhereTerm *whereScanInit(
 ){
   int j;
 
-  memset(pScan, 0, sizeof(*pScan));
+  /* memset(pScan, 0, sizeof(*pScan)); */
+  pScan->pCurrent = 0;
   pScan->pOrigWC = pWC;
   pScan->pWC = pWC;
   if( pIdx && iColumn>=0 ){
@@ -761,8 +762,12 @@ WhereTerm *whereScanInit(
       if( NEVER(j>=pIdx->nColumn) ) return 0;
     }
     pScan->zCollName = pIdx->azColl[j];
+  }else{
+    pScan->idxaff = 0;
+    pScan->zCollName = 0;
   }
   pScan->opMask = opMask;
+  pScan->k = 0;
   pScan->aEquiv[0] = iCur;
   pScan->aEquiv[1] = iColumn;
   pScan->nEquiv = 2;
@@ -4782,7 +4787,7 @@ static const char *wherePathName(WherePath *pPath, int nLoop, WhereLoop *pLast){
 ** error occurs.
 */
 static int wherePathSolver(WhereInfo *pWInfo, double nRowEst){
-  const int mxChoice = 10;  /* Maximum number of simultaneous paths tracked */
+  int mxChoice = 10;        /* Maximum number of simultaneous paths tracked */
   int nLoop;                /* Number of terms in the join */
   sqlite3 *db;              /* The database connection */
   int iLoop;                /* Loop counter over the terms of the join */
@@ -4801,6 +4806,7 @@ static int wherePathSolver(WhereInfo *pWInfo, double nRowEst){
 
   db = pWInfo->pParse->db;
   nLoop = pWInfo->nLevel;
+  mxChoice = (nLoop==1) ? 1 : (nLoop==2 ? 5 : 10);
   assert( nLoop<=pWInfo->pTabList->nSrc );
 #ifdef WHERETRACE_ENABLED
   if( sqlite3WhereTrace>=2 ) sqlite3DebugPrintf("---- begin solver\n");
@@ -4814,7 +4820,7 @@ static int wherePathSolver(WhereInfo *pWInfo, double nRowEst){
   aFrom = aTo+mxChoice;
   memset(aFrom, 0, sizeof(aFrom[0]));
   pX = (WhereLoop**)(aFrom+mxChoice);
-  for(ii=0, pFrom=aTo; ii<mxChoice*2; ii++, pFrom++, pX += nLoop){
+  for(ii=mxChoice*2, pFrom=aTo; ii>0; ii--, pFrom++, pX += nLoop){
     pFrom->aLoop = pX;
   }