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:
15
src/pager.c
15
src/pager.c
@@ -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{
|
||||
|
||||
|
Reference in New Issue
Block a user