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

Merge the latest trunk enhancements into the sqlite3_stmt_explain branch.

FossilOrigin-Name: 06eae046c1a1155f22590b88942db72f01482f2363da9753f8adfdb322679055
This commit is contained in:
drh
2023-07-19 10:17:42 +00:00
5 changed files with 17 additions and 13 deletions

View File

@@ -1764,11 +1764,10 @@ static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){
p->ovrfl = 1;
kahanBabuskaNeumaierInit(p, p->iSum);
p->approx = 1;
kahanBabuskaNeumaierStep(p, sqlite3_value_double(argv[0]));
kahanBabuskaNeumaierStepInt64(p, sqlite3_value_int64(argv[0]));
}
}
}else{
p->approx = 1;
if( type==SQLITE_INTEGER ){
kahanBabuskaNeumaierStepInt64(p, sqlite3_value_int64(argv[0]));
}else{

View File

@@ -5122,9 +5122,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
/* TUNING: A full-scan of a VIEW or subquery in the outer loop
** is not so bad. */
if( iLoop==0 && (pWLoop->wsFlags & WHERE_VIEWSCAN)!=0 ){
if( iLoop==0 && (pWLoop->wsFlags & WHERE_VIEWSCAN)!=0 && nLoop>1 ){
rCost += -10;
nOut += -30;
WHERETRACE(0x80,("VIEWSCAN cost reduction for %c\n",pWLoop->cId));
}
/* Check to see if pWLoop should be added to the set of