/ Check-in [c5a3a1af]
Login

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

Overview
Comment:Use memcmp() instead of the BINARY collating function where possible, for a performance boost.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c5a3a1af3c7bd34886e944a1fef2f6340ded24a0
User & Date: drh 2013-12-06 22:45:31
Context
2013-12-06
23:25
Performance optimization to the moveToRoot() subroutine in btree.c. check-in: b5842a70 user: drh tags: trunk
22:45
Use memcmp() instead of the BINARY collating function where possible, for a performance boost. check-in: c5a3a1af user: drh tags: trunk
22:44
Remove some commented-out code from sqlite3BtreeMovetoUnpacked() to try to make it more readable. check-in: 2d62d113 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/build.c.

4179
4180
4181
4182
4183
4184
4185
4186

4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
    }else{
      pKey = sqlite3KeyInfoAlloc(pParse->db, nCol, 0);
    }
    if( pKey ){
      assert( sqlite3KeyInfoIsWriteable(pKey) );
      for(i=0; i<nCol; i++){
        char *zColl = pIdx->azColl[i];
        if( NEVER(zColl==0) ) zColl = "BINARY";

        pKey->aColl[i] = sqlite3LocateCollSeq(pParse, zColl);
        pKey->aSortOrder[i] = pIdx->aSortOrder[i];
      }
      if( pParse->nErr ){
        sqlite3KeyInfoUnref(pKey);
      }else{
        pIdx->pKeyInfo = pKey;
      }
    }
  }
  return sqlite3KeyInfoRef(pIdx->pKeyInfo);
}







|
>
|











4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
    }else{
      pKey = sqlite3KeyInfoAlloc(pParse->db, nCol, 0);
    }
    if( pKey ){
      assert( sqlite3KeyInfoIsWriteable(pKey) );
      for(i=0; i<nCol; i++){
        char *zColl = pIdx->azColl[i];
        assert( zColl!=0 );
        pKey->aColl[i] = strcmp(zColl,"BINARY")==0 ? 0 :
                          sqlite3LocateCollSeq(pParse, zColl);
        pKey->aSortOrder[i] = pIdx->aSortOrder[i];
      }
      if( pParse->nErr ){
        sqlite3KeyInfoUnref(pKey);
      }else{
        pIdx->pKeyInfo = pKey;
      }
    }
  }
  return sqlite3KeyInfoRef(pIdx->pKeyInfo);
}