mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
A different approach to the autoindex problem that deletes query-planner code
rather than adding it. FossilOrigin-Name: f270fb6e9e0b5e77f918081962008c6195ab1e36
This commit is contained in:
@ -102,7 +102,7 @@ do_eqp_test rtree6.2.4.2 {
|
|||||||
SELECT * FROM t1,t2 WHERE v=10 and x1<10 and x2>10
|
SELECT * FROM t1,t2 WHERE v=10 and x1<10 and x2>10
|
||||||
} {
|
} {
|
||||||
0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1}
|
0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1}
|
||||||
0 1 1 {SCAN TABLE t2}
|
0 1 1 {SEARCH TABLE t2 USING AUTOMATIC COVERING INDEX (v=?)}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_eqp_test rtree6.2.5 {
|
do_eqp_test rtree6.2.5 {
|
||||||
|
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Simplification\sto\sthe\slogic\sthat\sprevents\sautomatic\sindexes\sfrom\sbeing\sformed\non\sconstant\sexpressions.
|
C A\sdifferent\sapproach\sto\sthe\sautoindex\sproblem\sthat\sdeletes\squery-planner\scode\nrather\sthan\sadding\sit.
|
||||||
D 2014-06-17T09:52:26.975
|
D 2014-06-17T12:33:55.348
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in ed5e4aae4799f724699d5509fac2977786414dbb
|
F Makefile.in ed5e4aae4799f724699d5509fac2977786414dbb
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@ -129,7 +129,7 @@ F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
|
|||||||
F ext/rtree/rtree3.test a494da55c30ee0bc9b01a91c80c81b387b22d2dc
|
F ext/rtree/rtree3.test a494da55c30ee0bc9b01a91c80c81b387b22d2dc
|
||||||
F ext/rtree/rtree4.test c8fe384f60ebd49540a5fecc990041bf452eb6e0
|
F ext/rtree/rtree4.test c8fe384f60ebd49540a5fecc990041bf452eb6e0
|
||||||
F ext/rtree/rtree5.test 6a510494f12454bf57ef28f45bc7764ea279431e
|
F ext/rtree/rtree5.test 6a510494f12454bf57ef28f45bc7764ea279431e
|
||||||
F ext/rtree/rtree6.test 83a997caf27eeca990291f66277e5a136428479a
|
F ext/rtree/rtree6.test 0cfbdf27ee086bf16a3da2c6f2d5b3d6473cb27e
|
||||||
F ext/rtree/rtree7.test 1fa710b9e6bf997a0c1a537b81be7bb6fded1971
|
F ext/rtree/rtree7.test 1fa710b9e6bf997a0c1a537b81be7bb6fded1971
|
||||||
F ext/rtree/rtree8.test db79c812f9e4a11f9b1f3f9934007884610a713a
|
F ext/rtree/rtree8.test db79c812f9e4a11f9b1f3f9934007884610a713a
|
||||||
F ext/rtree/rtree9.test d86ebf08ff6328895613ed577dd8a2a37c472c34
|
F ext/rtree/rtree9.test d86ebf08ff6328895613ed577dd8a2a37c472c34
|
||||||
@ -296,7 +296,7 @@ F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd
|
|||||||
F src/wal.c 264df50a1b33124130b23180ded2e2c5663c652a
|
F src/wal.c 264df50a1b33124130b23180ded2e2c5663c652a
|
||||||
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
||||||
F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45
|
F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45
|
||||||
F src/where.c 3214e390ca5ff0b19fb5084e5bd5870da623389d
|
F src/where.c cd3110c7dca304ecbdf2ed07b23205e90b10475b
|
||||||
F src/whereInt.h 929c1349b5355fd44f22cee5c14d72b3329c58a6
|
F src/whereInt.h 929c1349b5355fd44f22cee5c14d72b3329c58a6
|
||||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||||
@ -1177,7 +1177,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||||
P 58acc2a8b38c5f13175c191697b4d2b663db1872
|
P 36d67e1dd2b4f4c22d02f3c3b8d372074de5523a
|
||||||
R 91ed31168e6ce0a5afee4b984323de5e
|
R f31fb5c411bc798b3e39eb24696f39dc
|
||||||
U drh
|
U drh
|
||||||
Z ee443673993fc3ea86368d30ccfb6dad
|
Z d63276e1ce6bb05efdbf1c4b12bc995b
|
||||||
|
@ -1 +1 @@
|
|||||||
36d67e1dd2b4f4c22d02f3c3b8d372074de5523a
|
f270fb6e9e0b5e77f918081962008c6195ab1e36
|
10
src/where.c
10
src/where.c
@ -4529,7 +4529,6 @@ static int whereLoopAddBtree(
|
|||||||
WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
|
WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
|
||||||
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
|
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
|
||||||
if( pTerm->prereqRight & pNew->maskSelf ) continue;
|
if( pTerm->prereqRight & pNew->maskSelf ) continue;
|
||||||
if( sqlite3ExprIsConstant(pTerm->pExpr->pRight) ) continue;
|
|
||||||
if( termCanDriveIndex(pTerm, pSrc, 0) ){
|
if( termCanDriveIndex(pTerm, pSrc, 0) ){
|
||||||
pNew->u.btree.nEq = 1;
|
pNew->u.btree.nEq = 1;
|
||||||
pNew->u.btree.nSkip = 0;
|
pNew->u.btree.nSkip = 0;
|
||||||
@ -5279,7 +5278,6 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
|||||||
LogEst rCost; /* Cost of a path */
|
LogEst rCost; /* Cost of a path */
|
||||||
LogEst nOut; /* Number of outputs */
|
LogEst nOut; /* Number of outputs */
|
||||||
LogEst mxCost = 0; /* Maximum cost of a set of paths */
|
LogEst mxCost = 0; /* Maximum cost of a set of paths */
|
||||||
LogEst mxOut = 0; /* Maximum nOut value on the set of paths */
|
|
||||||
int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */
|
int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */
|
||||||
WherePath *aFrom; /* All nFrom paths at the previous level */
|
WherePath *aFrom; /* All nFrom paths at the previous level */
|
||||||
WherePath *aTo; /* The nTo best paths at the current level */
|
WherePath *aTo; /* The nTo best paths at the current level */
|
||||||
@ -5389,8 +5387,6 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
|||||||
for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){
|
for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){
|
||||||
if( pTo->maskLoop==maskNew
|
if( pTo->maskLoop==maskNew
|
||||||
&& ((pTo->isOrdered^isOrdered)&80)==0
|
&& ((pTo->isOrdered^isOrdered)&80)==0
|
||||||
&& ((pTo->rCost<=rCost && pTo->nRow<=nOut) ||
|
|
||||||
(pTo->rCost>=rCost && pTo->nRow>=nOut))
|
|
||||||
){
|
){
|
||||||
testcase( jj==nTo-1 );
|
testcase( jj==nTo-1 );
|
||||||
break;
|
break;
|
||||||
@ -5424,7 +5420,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}else{
|
}else{
|
||||||
if( pTo->rCost<=rCost && pTo->nRow<=nOut ){
|
if( pTo->rCost<=rCost ){
|
||||||
#ifdef WHERETRACE_ENABLED /* 0x4 */
|
#ifdef WHERETRACE_ENABLED /* 0x4 */
|
||||||
if( sqlite3WhereTrace&0x4 ){
|
if( sqlite3WhereTrace&0x4 ){
|
||||||
sqlite3DebugPrintf(
|
sqlite3DebugPrintf(
|
||||||
@ -5464,11 +5460,9 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
|||||||
if( nTo>=mxChoice ){
|
if( nTo>=mxChoice ){
|
||||||
mxI = 0;
|
mxI = 0;
|
||||||
mxCost = aTo[0].rCost;
|
mxCost = aTo[0].rCost;
|
||||||
mxOut = aTo[0].nRow;
|
|
||||||
for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){
|
for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){
|
||||||
if( pTo->rCost>mxCost || (pTo->rCost==mxCost && pTo->nRow>mxOut) ){
|
if( pTo->rCost>mxCost ){
|
||||||
mxCost = pTo->rCost;
|
mxCost = pTo->rCost;
|
||||||
mxOut = pTo->nRow;
|
|
||||||
mxI = jj;
|
mxI = jj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user