36 Commits

Author SHA1 Message Date
drh
a0f6b124ad Remove the unused PGHDR_NEED_READ flag. Add invariant checking (during
SQLITE_DEBUG builds only) for the PgHdr object.

FossilOrigin-Name: 771c5411e9ebcad00fb4b97556b519488284b87b
2016-05-13 15:22:06 +00:00
drh
72e6a39907 For in-memory databases, it does not matter if pcache entries are marked
"clean" or "writable".

FossilOrigin-Name: ad601c7962a60a11699cf31f1faee09b95d5c710
2016-05-11 23:54:14 +00:00
drh
6bcfe8b61f Add a function prototype in order to fix a compiler warning.
FossilOrigin-Name: 49aec9718d61c9f12aed96f530128666c3b01c81
2016-04-21 15:24:46 +00:00
dan
0f52455a35 On commit, flush dirty temp-file pages only if the file is already open and 25% or more of the cache is dirty.
FossilOrigin-Name: f6babf2920340f25815c0a3c58de1e902c2f5542
2016-04-13 16:52:11 +00:00
dan
d6f7c97952 If a single page is written to the wal file more than once, have each subsequent copy overwrite the original frame.
FossilOrigin-Name: 5d113aef2c7d746e8eda88d4e36c04a39b0a11be
2016-01-09 16:39:29 +00:00
drh
9b0cf34f81 First attempt at enhancing the "PRAGMA cache_spill" statement to accept a
cache threashold size.

FossilOrigin-Name: 549d42be0dac87dc04c3eeccfdc60615c3a6ad3f
2015-11-12 14:57:19 +00:00
drh
1aacbdb374 Add the PGHDR_WRITEABLE bit for PgHdr.flags which is used to
distinguish between pages that are on the dirty list and pages that are
safe to modify.

FossilOrigin-Name: 7c4ef7b7c8744af19075bb96d1e0b63e35978ed1
2015-06-29 18:29:10 +00:00
drh
c78ae916b9 Add the new PGHDR_CLEAN bit to PgHdr.flags in pcache.c. This bit is always
the opposite of PGHDR_DIRTY.  Use the extra bit to avoid a comparison
for a small performance boost.

FossilOrigin-Name: 8619fc346d9a5a66a3c4566b4cc032b6b6bf73fd
2015-06-29 04:21:15 +00:00
drh
def6889d21 Add the SQLITE_CONFIG_PCACHE_HDRSZ option for sqlite3_config().
FossilOrigin-Name: 6eb03e62a34e8e0964175283587247b0212db604
2014-11-04 12:11:23 +00:00
drh
bc59ac0e26 Refactor the sqlite3PcacheFetch() routine into three separate routines,
which are significantly faster overall and about 100 bytes smaller in
size as well.

FossilOrigin-Name: bdb6e4978d1a26d5f795262172605184264ede9c
2014-08-27 23:18:01 +00:00
drh
c3031c61ef Change the page cache so that a new sqlite3_pcache object is allocated as
soon as the page cache is opened, not delayed until the first fetch request.
This give a noticable performance boost.  The interface between pager and
the page cache has changed slightly, which might break ZIPVFS.

FossilOrigin-Name: f1f94a971e031e784f8c30a6faf829df58709329
2014-08-26 15:06:49 +00:00
dan
b2d3de3bf4 Use mmap() to read from the database file in rollback mode. This branch is unix only for now.
FossilOrigin-Name: 6f21d9cbf5d457e63a7282015a89ae785526cf6d
2013-03-14 18:34:37 +00:00
drh
a451017d62 Data structure cleanup. Remove unused fields. Rearrange other files for
tighter packing and reduced memory usage.

FossilOrigin-Name: 0bc594e861ae1142e8c6c83f39b095e1432856bf
2012-02-02 15:50:17 +00:00
drh
09419b4bae Add the sqlite3_db_release_memory() interface and the shrink_memory pragma.
FossilOrigin-Name: 3f58e7c8895d1252eff56282c08b1a6f1194452c
2011-11-16 19:29:17 +00:00
dan
22e21ff4fc Experimental change to the pcache interface to allow page buffers to be allocated separately from their associated container structures.
FossilOrigin-Name: c275c9d323cb1dccb031b199d413ac3a0b244fea
2011-11-08 20:08:44 +00:00
drh
c81c11f62c Remove the obsolete "$Id:$" RCS identifier strings from the source code.
FossilOrigin-Name: f6c045f649036958078cb15cd9d5453680c82b0c
2009-11-10 01:30:52 +00:00
danielk1977
750e87df2e Add files that should have gone in with the previous checkin. (CVS 6935)
FossilOrigin-Name: 64c7afc704e95e13fb3315be402525d277a0d8d8
2009-07-25 11:46:48 +00:00
danielk1977
bea2a94850 Big change to make pager.c easier to follow. Unused variables removed, comments improved, etc. (CVS 6197)
FossilOrigin-Name: 12f7346c13c180ed73d7a2e3b590be457360254a
2009-01-20 17:06:27 +00:00
danielk1977
45d6882fd9 Revert (6187). (CVS 6188)
FossilOrigin-Name: a353c1ab376b159c4d12532412365318cdbdcc60
2009-01-16 16:23:38 +00:00
danielk1977
443c0597fe This commit is an error. Reverted by (6188). (CVS 6187)
FossilOrigin-Name: aa67fd0cdb4f53a0c6e15c001d37554d15006718
2009-01-16 15:21:05 +00:00
danielk1977
f3d3c27a0c Fix some compiler warnings that show up when building the amalgamation only. (CVS 5927)
FossilOrigin-Name: d1abe8a1c9a990b02c71d6c249436381c9fde443
2008-11-19 16:52:44 +00:00
danielk1977
bc2ca9eb39 Add an API to support custom page cache implementations. (CVS 5899)
FossilOrigin-Name: 47866d6708e9b69e367937fd85f93580fd025447
2008-11-13 14:28:28 +00:00
danielk1977
b3175389c7 Add "pragma journal_mode=memory". Change the way rollback works for in-memory databases so that it reuses the journal_mode=memory code. (CVS 5830)
FossilOrigin-Name: 39ebf01addf9d0867daafd06a38719e725128f9c
2008-10-17 18:51:52 +00:00
drh
419fcf66db Conditionally omit prototypes in pcache.h when the corresponding routines
are not used.  Ticket #3430. (CVS 5805)

FossilOrigin-Name: 977ae12c365846e1bc582fd17146151953b5ed68
2008-10-11 17:42:28 +00:00
danielk1977
71d5d2cd49 Instead of storing a pointer to the parent page in the MemPage structure, have each B-Tree cursor keep track of the ancestry of the current page. (CVS 5747)
FossilOrigin-Name: 40425e93421286cca1965d7a5769084526210c7a
2008-09-29 11:49:47 +00:00
danielk1977
eaa06f6970 Avoid parsing the structure of b-tree pages (in sqlite3BtreeInitPage) more than is necessary. (CVS 5720)
FossilOrigin-Name: 6b998f3066754e219c266501327e5578c9406b63
2008-09-18 17:34:44 +00:00
drh
b3df2e1cfe Speed improvements for in-memory databases by omitting flag clearing on pages
where it is impossible for the flag to be set and by avoiding assert()s on
non-debugging builds.  Ticket #3384. (CVS 5715)

FossilOrigin-Name: a7fd9e622bc1050e78f227ec42b6ba90c87c865a
2008-09-17 20:06:26 +00:00
danielk1977
062d4cb0ae If a page is made eligible for recycling when more than the configured maximum number of pages are allocated, free it immediately instead of adding it to the LRU list. (CVS 5638)
FossilOrigin-Name: 4b12922dcb4547bf3a7276d0542b2e1d12ad338d
2008-08-29 09:10:02 +00:00
drh
a85f7e36e8 Miscellaneous cleanup in the new pcache code. (CVS 5629)
FossilOrigin-Name: da1777259f53c2e20c7ced06bf6f2a550f0ea0fc
2008-08-28 02:26:07 +00:00
danielk1977
a1fa00d95f Use a bitvec object to store the set of pages with the 'always-rollback' property for a transaction. (CVS 5622)
FossilOrigin-Name: 9e9325997e11a0368721ed7860f4c37de3502a9b
2008-08-27 15:16:33 +00:00
danielk1977
d491e1bfd1 Simplify the pcache module by only recycling clean pages from 'other' caches. This commit causes errors in test files ioerr5.test and malloc5.test because they test recycling dirty pages from other caches. (CVS 5615)
FossilOrigin-Name: 9e511e161bcb077450d31fca5dd20c2557f103b3
2008-08-26 18:05:48 +00:00
danielk1977
33e3216a3d Instead of marking a page as clean when sqlite3PagerDontWrite() is called, set a dedictated flag - PGHDR_DONT_WRITE. (CVS 5604)
FossilOrigin-Name: a323bd29a600abddbcc2cc9961ab84d82cccc5e5
2008-08-23 18:53:08 +00:00
danielk1977
a858aa2e8c When recycling a page, try to find one that does not require a call to xSync() on the journal file. Also simplify some of the mutex related things in pcache. (CVS 5597)
FossilOrigin-Name: 93dbc5427bebaa0b3d726731027caad3f70611c7
2008-08-22 16:22:17 +00:00
drh
777c5386c3 Move date+time functions to start-time initialization. Additional
start-time function cleanup. (CVS 5585)

FossilOrigin-Name: 80d6a31cb3851704c09ac9d99fe4bc241df3c180
2008-08-21 20:21:34 +00:00
danielk1977
67e3da7ad4 Fix the functionality associated with sqlite3_release_memory() and sqlite3_soft_heap_limit(). It is automatically disabled if the SQLITE_CONFIG_PAGECACHE option is used. (CVS 5576)
FossilOrigin-Name: d025866b09352b32a6d35b97144eaad2fafb7165
2008-08-21 12:19:44 +00:00
danielk1977
8c0a791a58 Add the pcache module from the experimental branch. Also change things so that most of the built-in SQL functions are kept in single static hash-table, rather than creating and populating a separate hash table for each open database connection. (CVS 5566)
FossilOrigin-Name: cb494e10d71852024647aaa254203579ad438ea9
2008-08-20 14:49:23 +00:00