mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-19 21:43:15 +03:00
Set the WHERE_UNIQUE flag on loops that can only run once.
FossilOrigin-Name: 510f4d8ecf6eb284f14b91951e7236505bd71203
This commit is contained in:
@@ -4017,6 +4017,12 @@ static int whereLoopAddBtreeIndex(
|
||||
pNew->nOut = (double)iRowEst * nInMul * nIn;
|
||||
}else if( pTerm->eOperator & (WO_EQ) ){
|
||||
pNew->wsFlags |= WHERE_COLUMN_EQ;
|
||||
if( iCol<0
|
||||
|| (pProbe->onError==OE_Abort && nInMul==1
|
||||
&& pNew->u.btree.nEq==pProbe->nColumn-1)
|
||||
){
|
||||
pNew->wsFlags |= WHERE_UNIQUE;
|
||||
}
|
||||
pNew->u.btree.nEq++;
|
||||
pNew->nOut = (double)iRowEst * nInMul;
|
||||
}else if( pTerm->eOperator & (WO_ISNULL) ){
|
||||
|
||||
Reference in New Issue
Block a user