/ Check-in [777fec84]
Login

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

Overview
Comment:Minor performance improvement in vdbeRecordCompareString().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | filter-clause
Files: files | file ages | folders
SHA3-256: 777fec84a5db968e033883920586ec0afef65578be0c1eb3021fce525111edde
User & Date: dan 2019-07-12 15:15:43
Context
2019-07-13
09:55
Trivial performance improvement for balance(). check-in: c7920f55 user: dan tags: filter-clause
2019-07-12
15:15
Minor performance improvement in vdbeRecordCompareString(). check-in: 777fec84 user: dan tags: filter-clause
2019-07-11
18:43
Change the parser on this branch to more closely match trunk. This saves a few more cycles. check-in: be01b801 user: dan tags: filter-clause
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  4596   4596       if( (szHdr + nStr) > nKey1 ){
  4597   4597         pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT;
  4598   4598         return 0;    /* Corruption */
  4599   4599       }
  4600   4600       nCmp = MIN( pPKey2->aMem[0].n, nStr );
  4601   4601       res = memcmp(&aKey1[szHdr], pPKey2->aMem[0].z, nCmp);
  4602   4602   
  4603         -    if( res==0 ){
         4603  +    if( res>0 ){
         4604  +      res = pPKey2->r2;
         4605  +    }else if( res<0 ){
         4606  +      res = pPKey2->r1;
         4607  +    }else{
  4604   4608         res = nStr - pPKey2->aMem[0].n;
  4605   4609         if( res==0 ){
  4606   4610           if( pPKey2->nField>1 ){
  4607   4611             res = sqlite3VdbeRecordCompareWithSkip(nKey1, pKey1, pPKey2, 1);
  4608   4612           }else{
  4609   4613             res = pPKey2->default_rc;
  4610   4614             pPKey2->eqSeen = 1;
  4611   4615           }
  4612   4616         }else if( res>0 ){
  4613   4617           res = pPKey2->r2;
  4614   4618         }else{
  4615   4619           res = pPKey2->r1;
  4616   4620         }
  4617         -    }else if( res>0 ){
  4618         -      res = pPKey2->r2;
  4619         -    }else{
  4620         -      res = pPKey2->r1;
  4621   4621       }
  4622   4622     }
  4623   4623   
  4624   4624     assert( vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, res)
  4625   4625          || CORRUPT_DB
  4626   4626          || pPKey2->pKeyInfo->db->mallocFailed
  4627   4627     );