1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-22 20:22:44 +03:00

Remove an unused subfunction parameter and an obsolete comment from the

query planner logic in where.c.

FossilOrigin-Name: 349a55cd8ba9ce65ebfd987ecfebd1204f7d0a85
This commit is contained in:
drh
2012-09-24 19:50:00 +00:00
parent 46ec5b63e2
commit 4d85fa760f
3 changed files with 19 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
C Change\sthe\sinternal\ssqlite3WhereBegin()\sto\sreport\sthat\sthe\sORDER\sBY\sclause\nis\ssatisfied\sby\sindices\susing\sthe\sWhereInfo.nOBSat\sfield\sof\sthe\sreturned\nstructure. C Remove\san\sunused\ssubfunction\sparameter\sand\san\sobsolete\scomment\sfrom\sthe\nquery\splanner\slogic\sin\swhere.c.
D 2012-09-24T15:30:54.533 D 2012-09-24T19:50:00.842
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5f4f26109f9d80829122e0e09f9cda008fa065fb F Makefile.in 5f4f26109f9d80829122e0e09f9cda008fa065fb
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -249,7 +249,7 @@ F src/vtab.c d8020c0a0e8ccc490ca449d7e665311b6e9f3ba9
F src/wal.c 5acb3e7bbd31f10ba39acad9ce6b399055337a9d F src/wal.c 5acb3e7bbd31f10ba39acad9ce6b399055337a9d
F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6 F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6
F src/walker.c 3d75ba73de15e0f8cd0737643badbeb0e002f07b F src/walker.c 3d75ba73de15e0f8cd0737643badbeb0e002f07b
F src/where.c af126a6cdb290c2d79ef18bb41bbca949c9cad61 F src/where.c 40708330a0e9bf79c0ab97109b8014fa04cce858
F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823 F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/aggnested.test 0be144b453e0622a085fae8665c32f5676708e00 F test/aggnested.test 0be144b453e0622a085fae8665c32f5676708e00
@@ -1016,7 +1016,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 67d8a99aceb56384a81b3f30d6c71743146d2cc9 F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9
P e081890cd77ad8de4bf55a8f8cf9d63bfaaf8218 P 22989f3588531efd555cc29d6c576e7a34b7edc4
R 4ad3ce4fdebd545cd663ab5469164871 R af274415395e47bec73279dd70f3872e
U drh U drh
Z 1dbcfbc31e18555fa81506ef779ada01 Z 2c59ca6ec247c019d5fe7043b4d83355

View File

@@ -1 +1 @@
22989f3588531efd555cc29d6c576e7a34b7edc4 349a55cd8ba9ce65ebfd987ecfebd1204f7d0a85

View File

@@ -1813,7 +1813,7 @@ static void TRACE_IDX_OUTPUTS(sqlite3_index_info *p){
*/ */
static void bestIndex( static void bestIndex(
Parse*, WhereClause*, struct SrcList_item*, Parse*, WhereClause*, struct SrcList_item*,
Bitmask, Bitmask, ExprList*, WhereCost*); Bitmask, Bitmask, WhereCost*);
/* /*
** This routine attempts to find an scanning strategy that can be used ** This routine attempts to find an scanning strategy that can be used
@@ -1867,7 +1867,7 @@ static void bestOrClauseIndex(
)); ));
if( pOrTerm->eOperator==WO_AND ){ if( pOrTerm->eOperator==WO_AND ){
WhereClause *pAndWC = &pOrTerm->u.pAndInfo->wc; WhereClause *pAndWC = &pOrTerm->u.pAndInfo->wc;
bestIndex(pParse, pAndWC, pSrc, notReady, notValid, 0, &sTermCost); bestIndex(pParse, pAndWC, pSrc, notReady, notValid, &sTermCost);
}else if( pOrTerm->leftCursor==iCur ){ }else if( pOrTerm->leftCursor==iCur ){
WhereClause tempWC; WhereClause tempWC;
tempWC.pParse = pWC->pParse; tempWC.pParse = pWC->pParse;
@@ -1877,7 +1877,7 @@ static void bestOrClauseIndex(
tempWC.a = pOrTerm; tempWC.a = pOrTerm;
tempWC.wctrlFlags = 0; tempWC.wctrlFlags = 0;
tempWC.nTerm = 1; tempWC.nTerm = 1;
bestIndex(pParse, &tempWC, pSrc, notReady, notValid, 0, &sTermCost); bestIndex(pParse, &tempWC, pSrc, notReady, notValid, &sTermCost);
}else{ }else{
continue; continue;
} }
@@ -3388,6 +3388,12 @@ static void bestBtreeIndex(
** best query plan and its cost into the WhereCost object supplied ** best query plan and its cost into the WhereCost object supplied
** as the last parameter. This function may calculate the cost of ** as the last parameter. This function may calculate the cost of
** both real and virtual table scans. ** both real and virtual table scans.
**
** This function does not take ORDER BY or DISTINCT into account. Nor
** does it remember the virtual table query plan. All it does is compute
** the cost while determining if an OR optimization is applicable. The
** details will be reconsidered later if the optimization is found to be
** applicable.
*/ */
static void bestIndex( static void bestIndex(
Parse *pParse, /* The parsing context */ Parse *pParse, /* The parsing context */
@@ -3395,13 +3401,12 @@ static void bestIndex(
struct SrcList_item *pSrc, /* The FROM clause term to search */ struct SrcList_item *pSrc, /* The FROM clause term to search */
Bitmask notReady, /* Mask of cursors not available for indexing */ Bitmask notReady, /* Mask of cursors not available for indexing */
Bitmask notValid, /* Cursors not available for any purpose */ Bitmask notValid, /* Cursors not available for any purpose */
ExprList *pOrderBy, /* The ORDER BY clause */
WhereCost *pCost /* Lowest cost query plan */ WhereCost *pCost /* Lowest cost query plan */
){ ){
#ifndef SQLITE_OMIT_VIRTUALTABLE #ifndef SQLITE_OMIT_VIRTUALTABLE
if( IsVirtual(pSrc->pTab) ){ if( IsVirtual(pSrc->pTab) ){
sqlite3_index_info *p = 0; sqlite3_index_info *p = 0;
bestVirtualIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost,&p); bestVirtualIndex(pParse, pWC, pSrc, notReady, notValid, 0, pCost, &p);
if( p->needToFreeIdxStr ){ if( p->needToFreeIdxStr ){
sqlite3_free(p->idxStr); sqlite3_free(p->idxStr);
} }
@@ -3409,7 +3414,7 @@ static void bestIndex(
}else }else
#endif #endif
{ {
bestBtreeIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, 0, pCost); bestBtreeIndex(pParse, pWC, pSrc, notReady, notValid, 0, 0, pCost);
} }
} }
@@ -4698,7 +4703,7 @@ WhereInfo *sqlite3WhereBegin(
WhereMaskSet *pMaskSet; /* The expression mask set */ WhereMaskSet *pMaskSet; /* The expression mask set */
WhereClause *pWC; /* Decomposition of the WHERE clause */ WhereClause *pWC; /* Decomposition of the WHERE clause */
struct SrcList_item *pTabItem; /* A single entry from pTabList */ struct SrcList_item *pTabItem; /* A single entry from pTabList */
WhereLevel *pLevel; /* A single level in the pWInfo list */ WhereLevel *pLevel; /* A single level in pWInfo->a[] */
int iFrom; /* First unused FROM clause element */ int iFrom; /* First unused FROM clause element */
int andFlags; /* AND-ed combination of all pWC->a[].wtFlags */ int andFlags; /* AND-ed combination of all pWC->a[].wtFlags */
sqlite3 *db; /* Database connection */ sqlite3 *db; /* Database connection */
@@ -4994,7 +4999,6 @@ WhereInfo *sqlite3WhereBegin(
WHERETRACE(("*** Optimizer selects table %d for loop %d" WHERETRACE(("*** Optimizer selects table %d for loop %d"
" with cost=%g and nRow=%g\n", " with cost=%g and nRow=%g\n",
bestJ, pLevel-pWInfo->a, bestPlan.rCost, bestPlan.plan.nRow)); bestJ, pLevel-pWInfo->a, bestPlan.rCost, bestPlan.plan.nRow));
/* The ALWAYS() that follows was added to hush up clang scan-build */
if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 ){ if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 ){
pWInfo->nOBSat = pOrderBy->nExpr; pWInfo->nOBSat = pOrderBy->nExpr;
} }