mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Change the pcache module to keep track of the total number of references to
all pages rather than the number of pages references, for a performance improvement and size reduction. FossilOrigin-Name: f00a9e1e998c4bd249a45444dc2d71a7e4903b8b
This commit is contained in:
@@ -5261,6 +5261,10 @@ int sqlite3PagerAcquire(
|
||||
#endif
|
||||
);
|
||||
|
||||
/* Optimization note: Adding the "pgno<=1" term before "pgno==0" here
|
||||
** allows the compiler optimizer to reuse the results of the "pgno>1"
|
||||
** test in the previous statement, and avoid testing pgno==0 in the
|
||||
** common case where pgno is large. */
|
||||
if( pgno<=1 && pgno==0 ){
|
||||
return SQLITE_CORRUPT_BKPT;
|
||||
}
|
||||
@@ -6390,7 +6394,7 @@ u8 sqlite3PagerIsreadonly(Pager *pPager){
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
/*
|
||||
** Return the number of references to the pager.
|
||||
** Return the sum of the reference counts for all pages held by pPager.
|
||||
*/
|
||||
int sqlite3PagerRefcount(Pager *pPager){
|
||||
return sqlite3PcacheRefCount(pPager->pPCache);
|
||||
|
Reference in New Issue
Block a user