Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | For in-memory databases, it does not matter if pcache entries are marked "clean" or "writable". |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
06c1e27ca868f247f8c27b03eb19aac0 |
User & Date: | drh 2016-05-12 12:08:48.058 |
Context
2016-05-12
| ||
17:06 | Add extra OPTIMIZATION-IF-FALSE comments where required to pcache.c. (check-in: 9d55b8f541 user: dan tags: trunk) | |
12:08 | For in-memory databases, it does not matter if pcache entries are marked "clean" or "writable". (check-in: 06c1e27ca8 user: drh tags: trunk) | |
12:01 | Remove an unnecessary call to sqlite3PcacheMakeClean() inside of the ROLLBACK logic. (check-in: 0dc50d9915 user: drh tags: trunk) | |
2016-05-11
| ||
23:54 | For in-memory databases, it does not matter if pcache entries are marked "clean" or "writable". (Closed-Leaf check-in: ad601c7962 user: drh tags: pager-dev) | |
Changes
Changes to src/pager.c.
︙ | ︙ | |||
2029 2030 2031 2032 2033 2034 2035 | } #endif sqlite3BitvecDestroy(pPager->pInJournal); pPager->pInJournal = 0; pPager->nRec = 0; if( rc==SQLITE_OK ){ | | | 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 | } #endif sqlite3BitvecDestroy(pPager->pInJournal); pPager->pInJournal = 0; pPager->nRec = 0; if( rc==SQLITE_OK ){ if( pagerFlushOnCommit(pPager) ){ sqlite3PcacheCleanAll(pPager->pPCache); }else{ sqlite3PcacheClearWritable(pPager->pPCache); } sqlite3PcacheTruncate(pPager->pPCache, pPager->dbSize); } |
︙ | ︙ |
Changes to src/pcache.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** This file implements that page cache. */ #include "sqliteInt.h" /* | | > > > > > > | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ** ************************************************************************* ** This file implements that page cache. */ #include "sqliteInt.h" /* ** A complete page cache is an instance of this structure. Every ** entry in the cache holds a single page of the database file. The ** btree layer only operates on the cached copy of the database pages. ** ** A page cache entry is "clean" if it exactly matches what is currently ** on disk. A page is "dirty" if it has been modified and needs to be ** persisted to disk. ** ** pDirty, pDirtyTail, pSynced: ** All dirty pages are linked into the doubly linked list using ** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order ** such that p was added to the list more recently than p->pDirtyNext. ** PCache.pDirty points to the first (newest) element in the list and ** pDirtyTail to the last (oldest). |
︙ | ︙ |
Changes to src/pcache.h.
︙ | ︙ | |||
22 23 24 25 26 27 28 | ** Every page in the cache is controlled by an instance of the following ** structure. */ struct PgHdr { sqlite3_pcache_page *pPage; /* Pcache object page handle */ void *pData; /* Page data */ void *pExtra; /* Extra content */ | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ** Every page in the cache is controlled by an instance of the following ** structure. */ struct PgHdr { sqlite3_pcache_page *pPage; /* Pcache object page handle */ void *pData; /* Page data */ void *pExtra; /* Extra content */ PgHdr *pDirty; /* Transient list of dirty sorted by pgno */ Pager *pPager; /* The pager this page is part of */ Pgno pgno; /* Page number for this page */ #ifdef SQLITE_CHECK_PAGES u32 pageHash; /* Hash of page content */ #endif u16 flags; /* PGHDR flags defined below */ |
︙ | ︙ |