From: drh Date: Wed, 5 Jun 2013 16:19:59 +0000 (+0000) Subject: Minor performance tuning of the NGQP. X-Git-Tag: version-3.8.0~130^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9d935a8aa0dcef214933cd14c2c454674f36431;p=thirdparty%2Fsqlite.git Minor performance tuning of the NGQP. FossilOrigin-Name: cbef38c2d123e7d5a02c2a2450e8b329e3e96ee9 --- diff --git a/manifest b/manifest index ae6211e19d..454d643033 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index ce1f9dfb25..2673f09571 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1c4a78807b7a28c9976ca8c5722ff4e2e8755b7e \ No newline at end of file +cbef38c2d123e7d5a02c2a2450e8b329e3e96ee9 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 3af73198e8..4229ddc7ec 100644 --- a/src/where.c +++ b/src/where.c @@ -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; ii0; ii--, pFrom++, pX += nLoop){ pFrom->aLoop = pX; }