Enhance the automatic index logic so that it creates a partial index when
doing so gives the same answer for less work.
FossilOrigin-Name: d95d0313c447f5baeabdb17284d8606331ab7d49
diff --git a/src/resolve.c b/src/resolve.c
index d6a865c..e507ccb 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -28,7 +28,7 @@
** is a helper function - a callback for the tree walker.
*/
static int incrAggDepth(Walker *pWalker, Expr *pExpr){
- if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.i;
+ if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n;
return WRC_Continue;
}
static void incrAggFunctionDepth(Expr *pExpr, int N){
@@ -36,7 +36,7 @@
Walker w;
memset(&w, 0, sizeof(w));
w.xExprCallback = incrAggDepth;
- w.u.i = N;
+ w.u.n = N;
sqlite3WalkExpr(&w, pExpr);
}
}