aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-11-06 12:17:24 +0000
committerdrh <drh@noemail.net>2014-11-06 12:17:24 +0000
commit179bac3a14924c42656efdfddc5bbfd8e8a2be32 (patch)
tree69fdc264b36995dbf49a13abdd4e621bc3a49aad /src
parent42f30bce1158008097d271fd06c31398cf631aea (diff)
downloadsqlite-179bac3a14924c42656efdfddc5bbfd8e8a2be32.tar.gz
sqlite-179bac3a14924c42656efdfddc5bbfd8e8a2be32.zip
On the ".scanstats on" output in the shell, initialize the estimated count for
the first loop of each subquery to the actual loop count. FossilOrigin-Name: d1c51c8455d5ce972a77720c2d56228646ced27c
Diffstat (limited to 'src')
-rw-r--r--src/shell.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c
index 3505e59d4..ca49e00a6 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1209,7 +1209,10 @@ static void display_scanstats(
}
sqlite3_stmt_scanstatus(p, i, SQLITE_SCANSTAT_SELECTID, (void*)&iSid);
if( iSid!=k ) continue;
- if( n==0 && k>0 ) fprintf(pArg->out, "-------- subquery %d --------\n", k);
+ if( n==0 ){
+ rEstLoop = (double)nLoop;
+ if( k>0 ) fprintf(pArg->out, "-------- subquery %d --------\n", k);
+ }
n++;
sqlite3_stmt_scanstatus(p, i, SQLITE_SCANSTAT_NVISIT, (void*)&nVisit);
sqlite3_stmt_scanstatus(p, i, SQLITE_SCANSTAT_EST, (void*)&rEst);