From: drh Date: Wed, 26 Oct 2016 17:57:40 +0000 (+0000) Subject: Small size reduction and performance improvement in whereScanNext(). X-Git-Tag: version-3.16.0~165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=392ddeb12d2bbf18e117ec9f5ef42d25047afd9a;p=thirdparty%2Fsqlite.git Small size reduction and performance improvement in whereScanNext(). FossilOrigin-Name: d861ee17eb900a607de6ec3f4a5d5c24cfb834a0 --- diff --git a/manifest b/manifest index 1d41c53d85..82d6964d00 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C If\sall\sbranches\sof\san\sOR\soptimize\sscan\sthat\sis\sthe\srhs\sof\sa\sLEFT\sJOIN\suse\sthe\nsame\sindex,\sset\sthe\sindex\scursor\sto\sreturn\sNULL\svalues\sif\sthere\sare\sno\smatches\nfor\sa\srow\son\sthe\slhs. -D 2016-10-26T16:05:10.157 +C Small\ssize\sreduction\sand\sperformance\simprovement\sin\swhereScanNext(). +D 2016-10-26T17:57:40.045 F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 5151cc64c4c05f3455f4f692ad11410a810d937f @@ -468,7 +468,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/wal.c 0b44e89742024d3b6992bf404d2ab692113e1e60 F src/wal.h bf03a23da3100ab25e5c0363450233cfee09cfc2 F src/walker.c 91a6df7435827e41cff6bb7df50ea00934ee78b0 -F src/where.c 125af074723cf390d0e71ed1ca385240e6d4ea7c +F src/where.c 694dd84a7017f2b284e1da55b5bf00bfd3e1f4e4 F src/whereInt.h 2bcc3d176e6091cb8f50a30b65c006e88a73614d F src/wherecode.c 717a65294df46f30e9b9933d2a63a4bcbca5a9a8 F src/whereexpr.c 379d0017fb7bc9e5a4d8cd4b056c747de946430e @@ -1528,7 +1528,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 86675ae0abc78960a2faec55d115804acfc3be6d e7b9bc678ecb75c594d9d3ade12a99a8d551cdc9 -R c240eb27502d404e84b4aff903524b82 -U dan -Z 498360080b36f95cb7f4a5ed51292736 +P ec9dab8054c71d112c68f58a45821b38c2a45677 +R 48fa39390c766bcfb2f028645ad7c897 +U drh +Z 1bf2b72e2a8cf9aca52b2af50acc10fd diff --git a/manifest.uuid b/manifest.uuid index 58c86f842e..7dd85778b9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ec9dab8054c71d112c68f58a45821b38c2a45677 \ No newline at end of file +d861ee17eb900a607de6ec3f4a5d5c24cfb834a0 \ No newline at end of file diff --git a/src/where.c b/src/where.c index d77c333c34..6395d86659 100644 --- a/src/where.c +++ b/src/where.c @@ -198,11 +198,14 @@ static WhereTerm *whereScanNext(WhereScan *pScan){ WhereTerm *pTerm; /* The term being tested */ int k = pScan->k; /* Where to start scanning */ - while( pScan->iEquiv<=pScan->nEquiv ){ - iCur = pScan->aiCur[pScan->iEquiv-1]; + assert( pScan->iEquiv<=pScan->nEquiv ); + pWC = pScan->pWC; + while(1){ iColumn = pScan->aiColumn[pScan->iEquiv-1]; if( iColumn==XN_EXPR && pScan->pIdxExpr==0 ) return 0; - while( (pWC = pScan->pWC)!=0 ){ + iCur = pScan->aiCur[pScan->iEquiv-1]; + assert( pWC!=0 ); + do{ for(pTerm=pWC->a+k; knTerm; k++, pTerm++){ if( pTerm->leftCursor==iCur && pTerm->u.leftColumn==iColumn @@ -252,15 +255,17 @@ static WhereTerm *whereScanNext(WhereScan *pScan){ testcase( pTerm->eOperator & WO_IS ); continue; } + pScan->pWC = pWC; pScan->k = k+1; return pTerm; } } } - pScan->pWC = pScan->pWC->pOuter; + pWC = pWC->pOuter; k = 0; - } - pScan->pWC = pScan->pOrigWC; + }while( pWC!=0 ); + if( pScan->iEquiv>=pScan->nEquiv ) break; + pWC = pScan->pOrigWC; k = 0; pScan->iEquiv++; }