mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-19 21:43:15 +03:00
Performance improvement for the OR-clause analysis in the NGQP.
FossilOrigin-Name: 9b1c4954e468d0acfb5787e6bff56d50a3e7bc1a
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Minor\sperformance\stuning\sof\sthe\sNGQP.
|
C Performance\simprovement\sfor\sthe\sOR-clause\sanalysis\sin\sthe\sNGQP.
|
||||||
D 2013-06-05T16:19:59.536
|
D 2013-06-05T17:53:43.355
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
|
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -289,7 +289,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83
|
|||||||
F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
|
F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
|
||||||
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
||||||
F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
|
F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
|
||||||
F src/where.c 7d8a020b2d60ff2b536e6325af18ed11c24f81e5
|
F src/where.c 35e510bf0de4925316934e0ae989db9d062069d5
|
||||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||||
F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
|
F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
|
||||||
@@ -1094,7 +1094,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||||
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
||||||
P 1c4a78807b7a28c9976ca8c5722ff4e2e8755b7e
|
P cbef38c2d123e7d5a02c2a2450e8b329e3e96ee9
|
||||||
R 4c15e208b04c5a33c6528133849a04db
|
R 0e9737367b7d6db3cdf59c7691a34aed
|
||||||
U drh
|
U drh
|
||||||
Z c639596f7b6bcfbd4cf032fe7e7c5fd1
|
Z 4606f36521508d3eb4fac531dd74f101
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
cbef38c2d123e7d5a02c2a2450e8b329e3e96ee9
|
9b1c4954e468d0acfb5787e6bff56d50a3e7bc1a
|
||||||
28
src/where.c
28
src/where.c
@@ -4430,17 +4430,6 @@ static int whereLoopAddOr(WhereLoopBuilder *pBuilder, Bitmask mExtra){
|
|||||||
if( pWC->wctrlFlags & WHERE_AND_ONLY ) return SQLITE_OK;
|
if( pWC->wctrlFlags & WHERE_AND_ONLY ) return SQLITE_OK;
|
||||||
pWCEnd = pWC->a + pWC->nTerm;
|
pWCEnd = pWC->a + pWC->nTerm;
|
||||||
pNew = pBuilder->pNew;
|
pNew = pBuilder->pNew;
|
||||||
pItem = pBuilder->pTabList->a + pNew->iTab;
|
|
||||||
iCur = pItem->iCursor;
|
|
||||||
sSubBuild = *pBuilder;
|
|
||||||
sSubBuild.pOrderBy = 0;
|
|
||||||
sSubBuild.pBest = &sBest;
|
|
||||||
tempWC.pParse = pWC->pParse;
|
|
||||||
tempWC.pMaskSet = pWC->pMaskSet;
|
|
||||||
tempWC.pOuter = pWC;
|
|
||||||
tempWC.op = TK_AND;
|
|
||||||
tempWC.wctrlFlags = 0;
|
|
||||||
tempWC.nTerm = 1;
|
|
||||||
|
|
||||||
for(pTerm=pWC->a; pTerm<pWCEnd && rc==SQLITE_OK; pTerm++){
|
for(pTerm=pWC->a; pTerm<pWCEnd && rc==SQLITE_OK; pTerm++){
|
||||||
if( (pTerm->eOperator & WO_OR)!=0
|
if( (pTerm->eOperator & WO_OR)!=0
|
||||||
@@ -4452,12 +4441,23 @@ static int whereLoopAddOr(WhereLoopBuilder *pBuilder, Bitmask mExtra){
|
|||||||
double rTotal = 0;
|
double rTotal = 0;
|
||||||
double nRow = 0;
|
double nRow = 0;
|
||||||
Bitmask prereq = mExtra;
|
Bitmask prereq = mExtra;
|
||||||
|
|
||||||
|
pItem = pBuilder->pTabList->a + pNew->iTab;
|
||||||
|
iCur = pItem->iCursor;
|
||||||
|
sSubBuild = *pBuilder;
|
||||||
|
sSubBuild.pOrderBy = 0;
|
||||||
|
sSubBuild.pBest = &sBest;
|
||||||
|
|
||||||
for(pOrTerm=pOrWC->a; pOrTerm<pOrWCEnd; pOrTerm++){
|
for(pOrTerm=pOrWC->a; pOrTerm<pOrWCEnd; pOrTerm++){
|
||||||
if( (pOrTerm->eOperator& WO_AND)!=0 ){
|
if( (pOrTerm->eOperator & WO_AND)!=0 ){
|
||||||
sSubBuild.pWC = &pOrTerm->u.pAndInfo->wc;
|
sSubBuild.pWC = &pOrTerm->u.pAndInfo->wc;
|
||||||
}else if( pOrTerm->leftCursor==iCur ){
|
}else if( pOrTerm->leftCursor==iCur ){
|
||||||
|
tempWC.pParse = pWC->pParse;
|
||||||
|
tempWC.pMaskSet = pWC->pMaskSet;
|
||||||
|
tempWC.pOuter = pWC;
|
||||||
|
tempWC.op = TK_AND;
|
||||||
|
tempWC.wctrlFlags = 0;
|
||||||
|
tempWC.nTerm = 1;
|
||||||
tempWC.a = pOrTerm;
|
tempWC.a = pOrTerm;
|
||||||
sSubBuild.pWC = &tempWC;
|
sSubBuild.pWC = &tempWC;
|
||||||
}else{
|
}else{
|
||||||
@@ -4787,7 +4787,7 @@ static const char *wherePathName(WherePath *pPath, int nLoop, WhereLoop *pLast){
|
|||||||
** error occurs.
|
** error occurs.
|
||||||
*/
|
*/
|
||||||
static int wherePathSolver(WhereInfo *pWInfo, double nRowEst){
|
static int wherePathSolver(WhereInfo *pWInfo, double nRowEst){
|
||||||
int mxChoice = 10; /* Maximum number of simultaneous paths tracked */
|
int mxChoice; /* Maximum number of simultaneous paths tracked */
|
||||||
int nLoop; /* Number of terms in the join */
|
int nLoop; /* Number of terms in the join */
|
||||||
sqlite3 *db; /* The database connection */
|
sqlite3 *db; /* The database connection */
|
||||||
int iLoop; /* Loop counter over the terms of the join */
|
int iLoop; /* Loop counter over the terms of the join */
|
||||||
|
|||||||
Reference in New Issue
Block a user