1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Reduce the number of calls to the subjRequiresPage() routine inside of pager.

FossilOrigin-Name: e50ff39a93a51b5a5be4f0e82a76104b81c9e2a4
This commit is contained in:
drh
2013-12-13 19:48:04 +00:00
parent da8a330a03
commit 16f9a81125
3 changed files with 13 additions and 16 deletions

View File

@@ -1024,15 +1024,12 @@ static char *print_pager_state(Pager *p){
static int subjRequiresPage(PgHdr *pPg){
Pager *pPager = pPg->pPager;
PagerSavepoint *p;
Pgno pgno;
Pgno pgno = pPg->pgno;
int i;
if( pPager->nSavepoint ){
pgno = pPg->pgno;
for(i=0; i<pPager->nSavepoint; i++){
p = &pPager->aSavepoint[i];
if( p->nOrig>=pgno && 0==sqlite3BitvecTest(p->pInSavepoint, pgno) ){
return 1;
}
for(i=0; i<pPager->nSavepoint; i++){
p = &pPager->aSavepoint[i];
if( p->nOrig>=pgno && 0==sqlite3BitvecTest(p->pInSavepoint, pgno) ){
return 1;
}
}
return 0;
@@ -5677,7 +5674,7 @@ static int pager_write(PgHdr *pPg){
** to the journal then we can return right away.
*/
sqlite3PcacheMakeDirty(pPg);
if( pageInJournal(pPg) && !subjRequiresPage(pPg) ){
if( pageInJournal(pPg) && (pPager->nSavepoint==0 || !subjRequiresPage(pPg)) ){
assert( !pagerUseWal(pPager) );
}else{