/ Check-in [4b853f02]
Login

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

Overview
Comment:Rearrange the order of some checks in the integrity_check pragma for a very slight performance gain.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4b853f020570bf4af1b14e03f35764c7d7a03a40af58efc783e06f2b883cef78
User & Date: drh 2018-06-06 19:48:19
Context
2018-06-06
20:29
Small performance optimization in sqlite3VdbeRecordCompareWithSkip() for the common case where the comparison is equal. check-in: 1e616e25 user: drh tags: trunk
19:48
Rearrange the order of some checks in the integrity_check pragma for a very slight performance gain. check-in: 4b853f02 user: drh tags: trunk
18:50
Fix the sqlite3BeginTrans() calls within the snapshot extension. check-in: 1fef7ad2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pragma.c.

  1560   1560           for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
  1561   1561             sqlite3VdbeAddOp2(v, OP_Integer, 0, 8+j); /* index entries counter */
  1562   1562           }
  1563   1563           assert( pParse->nMem>=8+j );
  1564   1564           assert( sqlite3NoTempsInRange(pParse,1,7+j) );
  1565   1565           sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0); VdbeCoverage(v);
  1566   1566           loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1);
         1567  +        if( !isQuick ){
         1568  +          /* Sanity check on record header decoding */
         1569  +          sqlite3VdbeAddOp3(v, OP_Column, iDataCur, pTab->nCol-1, 3);
         1570  +          sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
         1571  +        }
  1567   1572           /* Verify that all NOT NULL columns really are NOT NULL */
  1568   1573           for(j=0; j<pTab->nCol; j++){
  1569   1574             char *zErr;
  1570   1575             int jmp2;
  1571   1576             if( j==pTab->iPKey ) continue;
  1572   1577             if( pTab->aCol[j].notNull==0 ) continue;
  1573   1578             sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, j, 3);
................................................................................
  1602   1607               integrityCheckResultRow(v);
  1603   1608               sqlite3VdbeResolveLabel(v, addrCkOk);
  1604   1609               sqlite3ExprCachePop(pParse);
  1605   1610             }
  1606   1611             sqlite3ExprListDelete(db, pCheck);
  1607   1612           }
  1608   1613           if( !isQuick ){ /* Omit the remaining tests for quick_check */
  1609         -          /* Sanity check on record header decoding */
  1610         -          sqlite3VdbeAddOp3(v, OP_Column, iDataCur, pTab->nCol-1, 3);
  1611         -          sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
  1612   1614             /* Validate index entries for the current row */
  1613   1615             for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
  1614   1616               int jmp2, jmp3, jmp4, jmp5;
  1615   1617               int ckUniq = sqlite3VdbeMakeLabel(v);
  1616   1618               if( pPk==pIdx ) continue;
  1617   1619               r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3,
  1618   1620                                            pPrior, r1);