mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-19 21:43:15 +03:00
An improved method for avoiding the use of the STAT3 samples to compute
the estimated number of outputs when the left-most index is equality constrained. This check-in undoes the previous fix and applies a new one. FossilOrigin-Name: 127a5b776d16e1e23c5b3d454f6aaea67f1ded3a
This commit is contained in:
@@ -4420,7 +4420,7 @@ static int whereLoopAddBtreeIndex(
|
||||
pNew->nOut = saved_nOut>rDiv+10 ? saved_nOut - rDiv : 10;
|
||||
}
|
||||
#ifdef SQLITE_ENABLE_STAT3
|
||||
if( pNew->u.btree.nEq==1 && pProbe->nSample && saved_nEq==0
|
||||
if( pNew->u.btree.nEq==1 && pProbe->nSample
|
||||
&& OptimizationEnabled(db, SQLITE_Stat3) ){
|
||||
tRowcnt nOut = 0;
|
||||
if( (pTerm->eOperator & (WO_EQ|WO_ISNULL))!=0 ){
|
||||
@@ -4431,7 +4431,8 @@ static int whereLoopAddBtreeIndex(
|
||||
&& !ExprHasProperty(pTerm->pExpr, EP_xIsSelect) ){
|
||||
rc = whereInScanEst(pParse, pProbe, pTerm->pExpr->x.pList, &nOut);
|
||||
}
|
||||
if( rc==SQLITE_OK ) pNew->nOut = whereCost(nOut);
|
||||
assert( nOut==0 || rc==SQLITE_OK );
|
||||
if( nOut ) pNew->nOut = whereCost(nOut);
|
||||
}
|
||||
#endif
|
||||
if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){
|
||||
|
||||
Reference in New Issue
Block a user