/ Check-in [1b36fbb9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove unnecessary MemPage initialization resets in the autovacuum ptrmap processing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1b36fbb9f05f3a5844e198b489bff36ef6cd908c
User & Date: drh 2016-12-12 18:12:03
Context
2016-12-12
23:24
Add the --mmap option to the speedtest1 program and to the speed-check.sh script that is frequently used to run speedtest1. check-in: 1a636d5e user: drh tags: trunk
18:12
Remove unnecessary MemPage initialization resets in the autovacuum ptrmap processing. check-in: 1b36fbb9 user: drh tags: trunk
16:08
Faster operation for large in-memory databases. check-in: 9675518b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  3292   3292   ** map entries for the overflow pages as well.
  3293   3293   */
  3294   3294   static int setChildPtrmaps(MemPage *pPage){
  3295   3295     int i;                             /* Counter variable */
  3296   3296     int nCell;                         /* Number of cells in page pPage */
  3297   3297     int rc;                            /* Return code */
  3298   3298     BtShared *pBt = pPage->pBt;
  3299         -  u8 isInitOrig = pPage->isInit;
  3300   3299     Pgno pgno = pPage->pgno;
  3301   3300   
  3302   3301     assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  3303   3302     rc = btreeInitPage(pPage);
  3304         -  if( rc!=SQLITE_OK ){
  3305         -    goto set_child_ptrmaps_out;
  3306         -  }
         3303  +  if( rc!=SQLITE_OK ) return rc;
  3307   3304     nCell = pPage->nCell;
  3308   3305   
  3309   3306     for(i=0; i<nCell; i++){
  3310   3307       u8 *pCell = findCell(pPage, i);
  3311   3308   
  3312   3309       ptrmapPutOvflPtr(pPage, pCell, &rc);
  3313   3310   
................................................................................
  3318   3315     }
  3319   3316   
  3320   3317     if( !pPage->leaf ){
  3321   3318       Pgno childPgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);
  3322   3319       ptrmapPut(pBt, childPgno, PTRMAP_BTREE, pgno, &rc);
  3323   3320     }
  3324   3321   
  3325         -set_child_ptrmaps_out:
  3326         -  pPage->isInit = isInitOrig;
  3327   3322     return rc;
  3328   3323   }
  3329   3324   
  3330   3325   /*
  3331   3326   ** Somewhere on pPage is a pointer to page iFrom.  Modify this pointer so
  3332   3327   ** that it points to iTo. Parameter eType describes the type of pointer to
  3333   3328   ** be modified, as  follows:
................................................................................
  3347   3342     if( eType==PTRMAP_OVERFLOW2 ){
  3348   3343       /* The pointer is always the first 4 bytes of the page in this case.  */
  3349   3344       if( get4byte(pPage->aData)!=iFrom ){
  3350   3345         return SQLITE_CORRUPT_BKPT;
  3351   3346       }
  3352   3347       put4byte(pPage->aData, iTo);
  3353   3348     }else{
  3354         -    u8 isInitOrig = pPage->isInit;
  3355   3349       int i;
  3356   3350       int nCell;
  3357   3351       int rc;
  3358   3352   
  3359   3353       rc = btreeInitPage(pPage);
  3360   3354       if( rc ) return rc;
  3361   3355       nCell = pPage->nCell;
................................................................................
  3383   3377       if( i==nCell ){
  3384   3378         if( eType!=PTRMAP_BTREE || 
  3385   3379             get4byte(&pPage->aData[pPage->hdrOffset+8])!=iFrom ){
  3386   3380           return SQLITE_CORRUPT_BKPT;
  3387   3381         }
  3388   3382         put4byte(&pPage->aData[pPage->hdrOffset+8], iTo);
  3389   3383       }
  3390         -
  3391         -    pPage->isInit = isInitOrig;
  3392   3384     }
  3393   3385     return SQLITE_OK;
  3394   3386   }
  3395   3387   
  3396   3388   
  3397   3389   /*
  3398   3390   ** Move the open database page pDbPage to location iFreePage in the