From: drh Date: Mon, 10 Jun 2013 14:56:25 +0000 (+0000) Subject: Simplification and performance tweak to the high-speed NGQP bypass. X-Git-Tag: version-3.8.0~130^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b75ffaacab82d95b469ce2099df7b60b3b4a718;p=thirdparty%2Fsqlite.git Simplification and performance tweak to the high-speed NGQP bypass. FossilOrigin-Name: 0f8a38ee54208d6a477aa2482cd277b4808450f0 --- diff --git a/manifest b/manifest index a55fe673ef..d8a42f44d6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Performance\simprovements\sfor\swhereScan\smethods. -D 2013-06-10T12:34:45.199 +C Simplification\sand\sperformance\stweak\sto\sthe\shigh-speed\sNGQP\sbypass. +D 2013-06-10T14:56:25.426 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 eddcadac3d6d9ec6e969e2d2c9a07c18ee8326c0 +F src/where.c 2e75418eb48dbaa675c3e0a112cbd697bd66588c 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 8d1ba309211e8afa8be5520bbc1eecf6deacae07 -R eb89dcd4fc9448ac2059e0ee34e53951 +P aae14350a37ad50e4607953ab496cba006032873 +R c9c6efd382ece49dba030de75ba0bdde U drh -Z 8ab3224e95cf812319014fdeea79f2dd +Z 90f206413d760722d5039cb0107594a6 diff --git a/manifest.uuid b/manifest.uuid index 00d4b0108f..36d5135459 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -aae14350a37ad50e4607953ab496cba006032873 \ No newline at end of file +0f8a38ee54208d6a477aa2482cd277b4808450f0 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 37d1b151c8..8f25d1d968 100644 --- a/src/where.c +++ b/src/where.c @@ -5192,7 +5192,6 @@ static int whereSimpleFastCase(WhereLoopBuilder *pBuilder){ WhereLoop *pLoop; int iCur; int j; - int nOrderBy; Table *pTab; Index *pIdx; @@ -5205,29 +5204,19 @@ static int whereSimpleFastCase(WhereLoopBuilder *pBuilder){ iCur = pItem->iCursor; pWC = &pWInfo->sWC; pLoop = pBuilder->pNew; - pWInfo->a[0].pWLoop = pLoop; pLoop->wsFlags = 0; - pLoop->maskSelf = getMask(&pWInfo->sMaskSet, iCur); - pWInfo->a[0].iTabCur = iCur; -#ifdef SQLITE_DEBUG - pLoop->cId = '0'; -#endif - nOrderBy = pWInfo->pOrderBy ? pWInfo->pOrderBy->nExpr : 0; - pTerm = findTerm(pWC, iCur, -1, 1, WO_EQ, 0); + pTerm = findTerm(pWC, iCur, -1, 0, WO_EQ, 0); if( pTerm ){ pLoop->wsFlags = WHERE_COLUMN_EQ|WHERE_IPK|WHERE_ONEROW; pLoop->aLTerm[0] = pTerm; pLoop->nLTerm = 1; pLoop->u.btree.nEq = 1; pLoop->rRun = (WhereCost)10; - pLoop->nOut = (WhereCost)1; - pWInfo->nRowOut = 1; - pWInfo->nOBSat = nOrderBy; }else{ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ if( pIdx->onError==OE_None ) continue; for(j=0; jnColumn; j++){ - pTerm = findTerm(pWC, iCur, pIdx->aiColumn[j], 1, WO_EQ, pIdx); + pTerm = findTerm(pWC, iCur, pIdx->aiColumn[j], 0, WO_EQ, pIdx); if( pTerm==0 ) break; whereLoopResize(pWInfo->pParse->db, pLoop, j); pLoop->aLTerm[j] = pTerm; @@ -5241,13 +5230,22 @@ static int whereSimpleFastCase(WhereLoopBuilder *pBuilder){ pLoop->u.btree.nEq = j; pLoop->u.btree.pIndex = pIdx; pLoop->rRun = (WhereCost)15; - pLoop->nOut = (WhereCost)1; - pWInfo->nRowOut = 1; - pWInfo->nOBSat = nOrderBy; break; } } - return pLoop->wsFlags!=0; + if( pLoop->wsFlags ){ + pLoop->nOut = (WhereCost)1; + pWInfo->a[0].pWLoop = pLoop; + pLoop->maskSelf = getMask(&pWInfo->sMaskSet, iCur); + pWInfo->a[0].iTabCur = iCur; + pWInfo->nRowOut = 1; + pWInfo->nOBSat = pWInfo->pOrderBy ? pWInfo->pOrderBy->nExpr : 0; +#ifdef SQLITE_DEBUG + pLoop->cId = '0'; +#endif + return 1; + } + return 0; } /*