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:
@@ -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: {
|
||||
|
Reference in New Issue
Block a user