/ Check-in [d6afd98d]
Login

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

Overview
Comment:Move a branch condition in analyze.c inside an #ifdef SQLITE_ENABLE_STAT4 block.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d6afd98de3ee8b714dfd6477ead955096f623972
User & Date: dan 2017-02-22 19:41:16
Context
2017-02-23
16:30
Save a few bytes and a few cycles by setting Vdbe.expmask to zero for statements prepared using legacy interface sqlite3_prepare(). check-in: a8fd7052 user: dan tags: trunk
2017-02-22
19:49
Merge integrity_check and other improvements from trunk. check-in: fe073905 user: drh tags: auto-analyze
19:41
Move a branch condition in analyze.c inside an #ifdef SQLITE_ENABLE_STAT4 block. check-in: d6afd98d user: dan tags: trunk
19:27
Improve the performance of ANALYZE when SQLITE_ENABLE_STAT4 is defined. check-in: 737a8244 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/analyze.c.

   548    548   ** Copy the contents of sample *pNew into the p->a[] array. If necessary,
   549    549   ** remove the least desirable sample from p->a[] to make room.
   550    550   */
   551    551   static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
   552    552     Stat4Sample *pSample = 0;
   553    553     int i;
   554    554   
          555  +  assert( IsStat4 || nEqZero==0 );
          556  +
          557  +#ifdef SQLITE_ENABLE_STAT4
   555    558     /* Stat4Accum.nMaxEqZero is set to the maximum number of leading 0
   556    559     ** values in the anEq[] array of any sample in Stat4Accum.a[]. In
   557    560     ** other words, if nMaxEqZero is n, then it is guaranteed that there
   558    561     ** are no samples with Stat4Sample.anEq[m]==0 for (m>=n). */
   559         -  assert( IsStat4 || nEqZero==0 );
   560    562     if( nEqZero>p->nMaxEqZero ){
   561    563       p->nMaxEqZero = nEqZero;
   562    564     }
   563         -
   564         -#ifdef SQLITE_ENABLE_STAT4
   565    565     if( pNew->isPSample==0 ){
   566    566       Stat4Sample *pUpgrade = 0;
   567    567       assert( pNew->anEq[pNew->iCol]>0 );
   568    568   
   569    569       /* This sample is being added because the prefix that ends in column 
   570    570       ** iCol occurs many times in the table. However, if we have already
   571    571       ** added a sample that shares this prefix, there is no need to add