mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Enhance the query planner so that it is able to use partial indexes that use
AND-connected terms in the WHERE clause. FossilOrigin-Name: 065765902d2774d7432b9c00ea2efed26e0aaa5e
This commit is contained in:
@@ -2423,6 +2423,10 @@ static Bitmask columnsInIndex(Index *pIdx){
|
||||
static int whereUsablePartialIndex(int iTab, WhereClause *pWC, Expr *pWhere){
|
||||
int i;
|
||||
WhereTerm *pTerm;
|
||||
while( pWhere->op==TK_AND ){
|
||||
if( !whereUsablePartialIndex(iTab,pWC,pWhere->pLeft) ) return 0;
|
||||
pWhere = pWhere->pRight;
|
||||
}
|
||||
for(i=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
|
||||
Expr *pExpr = pTerm->pExpr;
|
||||
if( sqlite3ExprImpliesExpr(pExpr, pWhere, iTab)
|
||||
|
||||
Reference in New Issue
Block a user