mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Performance improvements for whereScan methods.
FossilOrigin-Name: aae14350a37ad50e4607953ab496cba006032873
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Add\sa\shigh-speed\sbypass\sfor\sthe\sNGQP\sfor\sthe\scommon\scase\sof\sa\ssimply\squery\nwith\squality\sconstraints\sthat\soutputs\sa\ssingle\srow.
|
C Performance\simprovements\sfor\swhereScan\smethods.
|
||||||
D 2013-06-10T12:17:03.683
|
D 2013-06-10T12:34:45.199
|
||||||
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 9fff9a5f3f227857aa0590026837a78696d3bba7
|
F src/where.c eddcadac3d6d9ec6e969e2d2c9a07c18ee8326c0
|
||||||
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 dfbca3acaeb862f24f25e7810a16ff2066111ff4 20eeccf1f24dd762f1bee9c3fe628c70ff01627f
|
P 8d1ba309211e8afa8be5520bbc1eecf6deacae07
|
||||||
R 1c99bcc201a3fe7c000749ac05c30a32
|
R eb89dcd4fc9448ac2059e0ee34e53951
|
||||||
U drh
|
U drh
|
||||||
Z f19cc889e5aa39da8409c75eaebc0bb3
|
Z 8ab3224e95cf812319014fdeea79f2dd
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
8d1ba309211e8afa8be5520bbc1eecf6deacae07
|
aae14350a37ad50e4607953ab496cba006032873
|
||||||
13
src/where.c
13
src/where.c
@@ -231,7 +231,6 @@ struct WhereTerm {
|
|||||||
** terms in the WHERE clause that are useful to the query planner.
|
** terms in the WHERE clause that are useful to the query planner.
|
||||||
*/
|
*/
|
||||||
struct WhereScan {
|
struct WhereScan {
|
||||||
WhereTerm *pCurrent; /* Most recent match */
|
|
||||||
WhereClause *pOrigWC; /* Original, innermost WhereClause */
|
WhereClause *pOrigWC; /* Original, innermost WhereClause */
|
||||||
WhereClause *pWC; /* WhereClause currently being scanned */
|
WhereClause *pWC; /* WhereClause currently being scanned */
|
||||||
char *zCollName; /* Required collating sequence, if not NULL */
|
char *zCollName; /* Required collating sequence, if not NULL */
|
||||||
@@ -779,12 +778,13 @@ WhereTerm *whereScanNext(WhereScan *pScan){
|
|||||||
Expr *pX; /* An expression being tested */
|
Expr *pX; /* An expression being tested */
|
||||||
WhereClause *pWC; /* Shorthand for pScan->pWC */
|
WhereClause *pWC; /* Shorthand for pScan->pWC */
|
||||||
WhereTerm *pTerm; /* The term being tested */
|
WhereTerm *pTerm; /* The term being tested */
|
||||||
|
int k = pScan->k; /* Where to start scanning */
|
||||||
|
|
||||||
while( pScan->iEquiv<=pScan->nEquiv ){
|
while( pScan->iEquiv<=pScan->nEquiv ){
|
||||||
iCur = pScan->aEquiv[pScan->iEquiv-2];
|
iCur = pScan->aEquiv[pScan->iEquiv-2];
|
||||||
iColumn = pScan->aEquiv[pScan->iEquiv-1];
|
iColumn = pScan->aEquiv[pScan->iEquiv-1];
|
||||||
while( (pWC = pScan->pWC)!=0 ){
|
while( (pWC = pScan->pWC)!=0 ){
|
||||||
for(pTerm=pWC->a+pScan->k; pScan->k<pWC->nTerm; pScan->k++, pTerm++){
|
for(pTerm=pWC->a+k; k<pWC->nTerm; k++, pTerm++){
|
||||||
if( pTerm->leftCursor==iCur && pTerm->u.leftColumn==iColumn ){
|
if( pTerm->leftCursor==iCur && pTerm->u.leftColumn==iColumn ){
|
||||||
if( (pTerm->eOperator & WO_EQUIV)!=0
|
if( (pTerm->eOperator & WO_EQUIV)!=0
|
||||||
&& pScan->nEquiv<ArraySize(pScan->aEquiv)
|
&& pScan->nEquiv<ArraySize(pScan->aEquiv)
|
||||||
@@ -828,20 +828,18 @@ WhereTerm *whereScanNext(WhereScan *pScan){
|
|||||||
){
|
){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pScan->pCurrent = pTerm;
|
pScan->k = k+1;
|
||||||
pScan->k++;
|
|
||||||
return pTerm;
|
return pTerm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pWC = pScan->pWC = pScan->pWC->pOuter;
|
pWC = pScan->pWC = pScan->pWC->pOuter;
|
||||||
pScan->k = 0;
|
k = 0;
|
||||||
}
|
}
|
||||||
pScan->pWC = pScan->pOrigWC;
|
pScan->pWC = pScan->pOrigWC;
|
||||||
pScan->k = 0;
|
k = 0;
|
||||||
pScan->iEquiv += 2;
|
pScan->iEquiv += 2;
|
||||||
}
|
}
|
||||||
pScan->pCurrent = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -867,7 +865,6 @@ WhereTerm *whereScanInit(
|
|||||||
int j;
|
int j;
|
||||||
|
|
||||||
/* memset(pScan, 0, sizeof(*pScan)); */
|
/* memset(pScan, 0, sizeof(*pScan)); */
|
||||||
pScan->pCurrent = 0;
|
|
||||||
pScan->pOrigWC = pWC;
|
pScan->pOrigWC = pWC;
|
||||||
pScan->pWC = pWC;
|
pScan->pWC = pWC;
|
||||||
if( pIdx && iColumn>=0 ){
|
if( pIdx && iColumn>=0 ){
|
||||||
|
|||||||
Reference in New Issue
Block a user