From: drh Date: Tue, 13 Feb 2007 01:38:31 +0000 (+0000) Subject: Additional fixes to the new fragmentation feature of sqlite3_analyzer. (CVS 3635) X-Git-Tag: version-3.6.10~2535 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a0b77b0d2e61d8e3dbf90150487b757bc59933f;p=thirdparty%2Fsqlite.git Additional fixes to the new fragmentation feature of sqlite3_analyzer. (CVS 3635) FossilOrigin-Name: 82aed271a4a69e3dad6013b83cc7d492b7fed164 --- diff --git a/manifest b/manifest index bc4fda1370..3e9babfa0a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Changes\sto\ssupport\sfragmentation\sanalysis\sin\ssqlite3_analyzer.\s(CVS\s3634) -D 2007-02-10T19:22:36 +C Additional\sfixes\sto\sthe\snew\sfragmentation\sfeature\sof\ssqlite3_analyzer.\s(CVS\s3635) +D 2007-02-13T01:38:31 F Makefile.in 7fa74bf4359aa899da5586e394d17735f221315f F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -374,7 +374,7 @@ F tool/report1.txt 9eae07f26a8fc53889b45fc833a66a33daa22816 F tool/showdb.c a086a3d788c7a23cb008317c3180ceb19f20bce0 F tool/showjournal.c ec3b171be148656827c4949fbfb8ab4370822f87 F tool/space_used.tcl f714c41a59e326b8b9042f415b628b561bafa06b -F tool/spaceanal.tcl 2614b0c929852547138d608f58535f33a49d27ec +F tool/spaceanal.tcl 5c7b01742b169f26e0827443cff3237b5ac0c3e0 F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F www/arch.fig d5f9752a4dbf242e9cfffffd3f5762b6c63b3bcf @@ -432,7 +432,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 3638823a629164e4158f76d03ff2cea1eab34e9d -R 51a9ab370b25f99fa741aa9c670f3eea +P bd6bc3b8f06919000fb082087dff7bbd335d07e9 +R 9574e51e506c642515ff3bf6d38823de U drh -Z bcbf10610bf7092c876385c4549956cc +Z d89d00f5591338617153a19c97515562 diff --git a/manifest.uuid b/manifest.uuid index eb3f657c95..4cc86d8f0d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -bd6bc3b8f06919000fb082087dff7bbd335d07e9 \ No newline at end of file +82aed271a4a69e3dad6013b83cc7d492b7fed164 \ No newline at end of file diff --git a/tool/spaceanal.tcl b/tool/spaceanal.tcl index 3ae0a8209e..817febdfb1 100644 --- a/tool/spaceanal.tcl +++ b/tool/spaceanal.tcl @@ -231,7 +231,7 @@ foreach {name rootpage} [db eval $sql] { # Check the page list for fragmentation # foreach pg $pglist { - if {($pg<$prev_pgno || $pg>$prev_pgno+$MAXGAP) && $prev_pgno>0} { + if {$pg!=$prev_pgno+1 && $prev_pgno>0} { incr gap_cnt } set prev_pgno $pg @@ -352,7 +352,7 @@ foreach {name tbl_name rootpage} [db eval $sql] { incr leaf_pages incr unused_leaf $ci(page_freebytes) set pg $ci(page_no) - if {$prev_pgno>0 && ($prev_pgno<$pg-$MAXGAP || $prev_pgno>$pg)} { + if {$prev_pgno>0 && $pg!=$prev_pgno+1} { incr gap_cnt } set prev_pgno $ci(page_no) @@ -484,7 +484,6 @@ proc subreport {title where} { set total_unused [expr {$ovfl_unused+$int_unused+$leaf_unused}] set avg_payload [divide $payload $nleaf] set avg_unused [divide $total_unused $nleaf] - set fragmentation [percent $gap_cnt $total_pages {fragmentation}] if {$int_pages>0} { # TODO: Is this formula correct? set nTab [mem eval " @@ -512,6 +511,7 @@ proc subreport {title where} { statline {Average fanout} $avg_fanout } if {$total_pages>1} { + set fragmentation [percent $gap_cnt [expr {$total_pages-1}] {fragmentation}] statline {Fragmentation} $fragmentation } statline {Maximum payload per entry} $mx_payload