1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Change the SQLITE_SCANSTAT_EST parameter so that it returns a double for

the estimated number of output rows per loop, rather than a 64-bit integer.
Revise the output format for the ".scanstats on" in the shell to make use
of this new capability.

FossilOrigin-Name: f9684000665ae7ef6f89c3773612b8286b8f545a
This commit is contained in:
drh
2014-11-06 03:55:10 +00:00
parent e1db0db899
commit 518140ed04
11 changed files with 85 additions and 76 deletions

View File

@@ -1500,7 +1500,13 @@ int sqlite3_stmt_scanstatus(
break;
}
case SQLITE_SCANSTAT_EST: {
*(sqlite3_int64*)pOut = pScan->nEst;
double r = 1.0;
LogEst x = pScan->nEst;
while( x<100 ){
x += 10;
r *= 0.5;
}
*(double*)pOut = r*sqlite3LogEstToInt(x);
break;
}
case SQLITE_SCANSTAT_NAME: {