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
This commit is contained in:
drh 2014-11-06 12:17:24 +00:00
parent 42f30bce11
commit 179bac3a14
3 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Changes\sthe\sformatting\sof\s".scanstats\son"\sin\sthe\sshell\sso\sthat\sthe\sstats\sfor\nsubqueries\sare\sgrouped\stogether\sand\soccur\safter\sthe\smain\squery.
D 2014-11-06T12:08:21.237
C On\sthe\s".scanstats\son"\soutput\sin\sthe\sshell,\sinitialize\sthe\sestimated\scount\sfor\nthe\sfirst\sloop\sof\seach\ssubquery\sto\sthe\sactual\sloop\scount.
D 2014-11-06T12:17:24.789
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -228,7 +228,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
F src/resolve.c 4965007d6497b6a4d7a6d98751cc39712885f952
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
F src/select.c 428165951748151e87a15295b7357221433e311b
F src/shell.c 22c7c693f322091b26e9333a8fa50c56e4aba667
F src/shell.c 64a941c079837fd1a0d920273832e6275b777402
F src/sqlite.h.in 087d30a4c7ec7ae19bcaa03a9db9d6ee7a73b0b3
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
@ -1211,7 +1211,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 64ad5761a841f71530d41565b9fbe9d19c2d6aff
R 301cd68395834791ac0b2ebb68f39e69
P eacbbd8849db9b023eff15ef1cb42ec941299433
R c65acc2e5374aae8ca471af05c87c9aa
U drh
Z c6dcae9ced19f9079c51a47717359be1
Z b18ed09265a53348fca40701c374436f

View File

@ -1 +1 @@
eacbbd8849db9b023eff15ef1cb42ec941299433
d1c51c8455d5ce972a77720c2d56228646ced27c

View File

@ -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);