-C Comment\sout\sa\srecently\sadded\sassert\sstatement\sthat\sis\sfailing.\s(CVS\s6340)
-D 2009-03-05T14:53:18
+C Begin\spurging\sdirty\spages\sfrom\sthe\scache\sonce\s90%\sof\sthe\scache\sis\sdirty\s(insteadof\swaiting\suntil\sit\sis\s100%\sdirty).\sThis\simproves\sperformance\sin\ssome\scircumstances\sby\seffectively\sreserving\s10%\sof\sthe\sconfigured\spage-cache\sfor\sfrequently\sreused\sread-only\spages.\s(CVS\s6341)
+D 2009-03-05T14:59:40
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in d64baddbf55cdf33ff030e14da837324711a4ef7
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/parse.y c315b6f9bf6c7e7ec985481f81b6a45dba6c26d0
F src/pcache.c fcf7738c83c4d3e9d45836b2334c8a368cc41274
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
-F src/pcache1.c dabb8ab14827e090321f17150ce96fda172974e8
+F src/pcache1.c f12518540ba776df3051215c4244e9cdc06b09cd
F src/pragma.c 22ed04836aab8ce134c53be1ca896f3ad20fabdb
F src/prepare.c 1a2d40c0c5fb9f244cf5e3aacc33abcc1e7b095a
F src/printf.c 9866a9a9c4a90f6d4147407f373df3fd5d5f9b6f
F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4
F test/pageropt.test 3ee6578891baaca967f0bd349e4abfa736229e1a
F test/pagesize.test 0d9ff3fedfce6e5ffe8fa7aca9b6d3433a2e843b
-F test/pcache.test ccd18b4d2b432f44319a82b0367ed843ee18cebd
+F test/pcache.test 70ad1d65cf73f6a0a7501e0236312eb214d93a55
F test/pcache2.test 46efd980a89f737847b99327bda19e08fe11e402
F test/permutations.test 2e777ae1eeb11b777b31aad929c4351464758441
F test/pragma.test a35b0be36542477183168cdb8b743f5c0d883c4d
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 68abcb278ced40c0d97af724dbd1b751a3becdc2
-R 0b19691adcd1739892b0541fe5daf832
+P d0b2015f1caf2fc60ec82bd8e760f7b61befa3b4
+R 039bb14c767370b62d0edeb68de61ac0
U danielk1977
-Z e314e181dfce2d061b5e2a985f7bf325
+Z 7a03629d714ccf300df7a819fca83b05
** If the default page cache implementation is overriden, then neither of
** these two features are available.
**
-** @(#) $Id: pcache1.c,v 1.8 2009/01/23 16:45:01 danielk1977 Exp $
+** @(#) $Id: pcache1.c,v 1.9 2009/03/05 14:59:40 danielk1977 Exp $
*/
#include "sqliteInt.h"
nPinned = pCache->nPage - pCache->nRecyclable;
if( createFlag==1 && pCache->bPurgeable && (
nPinned>=(pcache1.nMaxPage+pCache->nMin-pcache1.nMinPage)
- || nPinned>=(pCache->nMax)
+ || nPinned>=(pCache->nMax * 9 / 10)
)){
goto fetch_out;
}
#
# This file is focused on testing the pcache module.
#
-# $Id: pcache.test,v 1.3 2009/01/07 15:33:46 drh Exp $
+# $Id: pcache.test,v 1.4 2009/03/05 14:59:40 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_test pcache-1.2 {
sqlite3 db test.db
execsql {
- PRAGMA cache_size=10;
+ PRAGMA cache_size=12;
PRAGMA auto_vacuum=0;
}
pcache_stats
-} {current 1 max 10 min 10 recyclable 1}
+} {current 1 max 12 min 10 recyclable 1}
do_test pcache-1.3 {
execsql {
CREATE TABLE t5(a, b, c);
}
pcache_stats
-} {current 6 max 10 min 10 recyclable 0}
+} {current 6 max 12 min 10 recyclable 0}
do_test pcache-1.4 {
execsql {
CREATE TABLE t9(a, b, c);
}
pcache_stats
-} {current 10 max 10 min 10 recyclable 0}
+} {current 10 max 12 min 10 recyclable 0}
do_test pcache-1.5 {
sqlite3 db2 test.db
execsql "PRAGMA cache_size=10" db2
pcache_stats
-} {current 11 max 20 min 20 recyclable 1}
+} {current 11 max 22 min 20 recyclable 1}
do_test pcache-1.6.1 {
execsql {
SELECT * FROM sqlite_master;
} db2
pcache_stats
-} {current 11 max 20 min 20 recyclable 0}
+} {current 11 max 22 min 20 recyclable 0}
# At this point connection db2 has a read lock on the database file and a
# single pinned page in its cache. Connection [db] is holding 10 dirty
CREATE INDEX i7 ON t7(a, b);
CREATE INDEX i8 ON t8(a, b);
CREATE INDEX i9 ON t9(a, b);
+ CREATE INDEX i10 ON t9(a, b);
+ CREATE INDEX i11 ON t9(a, b);
}
pcache_stats
-} {current 20 max 20 min 20 recyclable 0}
+} {current 23 max 22 min 20 recyclable 0}
do_test pcache-1.7 {
execsql {
CREATE TABLE t10(a, b, c);
}
pcache_stats
-} {current 21 max 20 min 20 recyclable 0}
+} {current 24 max 22 min 20 recyclable 0}
# Rolling back the transaction held by db2 at this point releases a pinned
# page. Because the number of allocated pages is greater than the
do_test pcache-1.8 {
execsql {ROLLBACK} db2
pcache_stats
-} {current 20 max 20 min 20 recyclable 0}
+} {current 23 max 22 min 20 recyclable 0}
do_test pcache-1.9 {
execsql COMMIT
pcache_stats
-} {current 20 max 20 min 20 recyclable 20}
+} {current 22 max 22 min 20 recyclable 22}
do_test pcache-1.10 {
db2 close
pcache_stats
-} {current 10 max 10 min 10 recyclable 10}
+} {current 12 max 12 min 10 recyclable 12}
do_test pcache-1.11 {
execsql { PRAGMA cache_size = 20 }
pcache_stats
-} {current 10 max 20 min 10 recyclable 10}
+} {current 12 max 20 min 10 recyclable 12}
do_test pcache-1.12 {
execsql {