Performance improvements (CVS 1379)
FossilOrigin-Name: cad47917267d32ab00c8b949151c8bc3c6638479
This commit is contained in:
parent
e6c438166f
commit
10617cddf6
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Table\s1\sof\sa\sdatabase\s(the\ssqlite_master\stable)\sdefaults\sto\suse\sB+trees.\s(CVS\s1378)
|
||||
D 2004-05-14T12:17:46
|
||||
C Performance\simprovements\s(CVS\s1379)
|
||||
D 2004-05-14T15:27:28
|
||||
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
|
||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||
@ -23,7 +23,7 @@ F sqlite.def fc4f5734786fe4743cfe2aa98eb2da4b089edb5f
|
||||
F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2
|
||||
F src/attach.c c315c58cb16fd6e913b3bfa6412aedecb4567fa5
|
||||
F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79
|
||||
F src/btree.c 4f1c77b78efce07f17b335251316e8c028827049
|
||||
F src/btree.c 085a020c22aceb08c42004ffdbfc4daad68fd7eb
|
||||
F src/btree.h 6f51ad0ffebfba71295fcacdbe86007512200050
|
||||
F src/btree_rb.c 9d7973e266ee6f9c61ce592f68742ce9cd5b10e5
|
||||
F src/build.c e93f443a20eab57ffb77ff6244b1e09a1f7d9390
|
||||
@ -63,10 +63,10 @@ F src/update.c 0441f8b64d616ef244583449e66c984e536c6c9b
|
||||
F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f
|
||||
F src/util.c 58407b133dfe0b21af23e0aa89c058a2b3d8cb0f
|
||||
F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
|
||||
F src/vdbe.c b63179da52797686c75c010ba742ceb8d197a3d1
|
||||
F src/vdbe.c fff79c08b3063d8d6f7b600fc6896c255c72238c
|
||||
F src/vdbe.h 94457ca73bae972dc61bca33a4dccc2e6e14e2f8
|
||||
F src/vdbeInt.h 03f4c3642482570a697a42a9bbb12908c6535bbe
|
||||
F src/vdbeaux.c d8dc16e7bfb6201a2e2e4c020ba813e295de717f
|
||||
F src/vdbeaux.c 4590e8f5e064ee1e269a0b969f6f28118daf325d
|
||||
F src/where.c 6957bbd333cc7ffa7b3878adbe67a095319daa54
|
||||
F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242
|
||||
F test/attach.test cb9b884344e6cfa5e165965d5b1adea679a24c83
|
||||
@ -191,7 +191,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
|
||||
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
|
||||
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
|
||||
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
|
||||
P c6604a94d25d148fbb42b47ae9a8195e4697c681
|
||||
R e9a50b542329deb82612b2b06751e47c
|
||||
P 45b60de5c7deb83d10ab54759434e32847f0c2ef
|
||||
R 623a239c3e485e25d3fc8763ec1b417b
|
||||
U drh
|
||||
Z a20ab9adf0eaf642c04b312d2e365440
|
||||
Z c81eb274ca540aa5e441cb23ee2aa0aa
|
||||
|
@ -1 +1 @@
|
||||
45b60de5c7deb83d10ab54759434e32847f0c2ef
|
||||
cad47917267d32ab00c8b949151c8bc3c6638479
|
15
src/btree.c
15
src/btree.c
@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.135 2004/05/14 12:17:46 drh Exp $
|
||||
** $Id: btree.c,v 1.136 2004/05/14 15:27:28 drh Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@ -741,18 +741,20 @@ static int initPage(
|
||||
int c, pc, i, hdr;
|
||||
unsigned char *data;
|
||||
int usableSize;
|
||||
int sumCell = 0; /* Total size of all cells */
|
||||
/* int sumCell = 0; // Total size of all cells */
|
||||
|
||||
|
||||
assert( pPage->pBt!=0 );
|
||||
assert( pParent==0 || pParent->pBt==pPage->pBt );
|
||||
assert( pPage->pgno==sqlite3pager_pagenumber(pPage->aData) );
|
||||
assert( pPage->aData == &((unsigned char*)pPage)[-pPage->pBt->pageSize] );
|
||||
assert( pPage->pParent==0 || pPage->pParent==pParent );
|
||||
assert( pPage->pParent==pParent || !pPage->isInit );
|
||||
if( pPage->isInit ) return SQLITE_OK;
|
||||
if( pPage->pParent==0 && pParent!=0 ){
|
||||
pPage->pParent = pParent;
|
||||
sqlite3pager_ref(pParent->aData);
|
||||
}
|
||||
if( pPage->isInit ) return SQLITE_OK;
|
||||
pPage->nCell = pPage->nCellAlloc = 0;
|
||||
assert( pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0) );
|
||||
hdr = pPage->hdrOffset;
|
||||
@ -782,7 +784,7 @@ static int initPage(
|
||||
pc = get2byte(&data[hdr+3]);
|
||||
for(i=0; pc>0; i++){
|
||||
pPage->aCell[i] = &data[pc];
|
||||
sumCell += cellSize(pPage, &data[pc]);
|
||||
/* sumCell += cellSize(pPage, &data[pc]); */
|
||||
pc = get2byte(&data[pc]);
|
||||
}
|
||||
|
||||
@ -801,10 +803,11 @@ static int initPage(
|
||||
if( pPage->nFree>=usableSize ) return SQLITE_CORRUPT;
|
||||
|
||||
/* Sanity check: Cells and freespace and header must sum to the size
|
||||
** a page. */
|
||||
** a page.
|
||||
if( sumCell+pPage->nFree+hdr+10-pPage->leaf*4 != usableSize ){
|
||||
return SQLITE_CORRUPT;
|
||||
}
|
||||
*/
|
||||
|
||||
pPage->isInit = 1;
|
||||
pageIntegrity(pPage);
|
||||
@ -879,7 +882,7 @@ static int getAndInitPage(
|
||||
){
|
||||
int rc;
|
||||
rc = getPage(pBt, pgno, ppPage);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( rc==SQLITE_OK && (*ppPage)->isInit==0 ){
|
||||
rc = initPage(*ppPage, pParent);
|
||||
}
|
||||
return rc;
|
||||
|
12
src/vdbe.c
12
src/vdbe.c
@ -43,7 +43,7 @@
|
||||
** in this file for details. If in doubt, do not deviate from existing
|
||||
** commenting and indentation practices when changing or adding code.
|
||||
**
|
||||
** $Id: vdbe.c,v 1.290 2004/05/14 12:16:11 danielk1977 Exp $
|
||||
** $Id: vdbe.c,v 1.291 2004/05/14 15:27:29 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@ -2001,7 +2001,7 @@ case OP_Column: {
|
||||
/* This code will run very infrequently (e.g. tables with several
|
||||
** hundred columns).
|
||||
*/
|
||||
zData = (char *)sqliteMalloc(offset+max_space);
|
||||
zData = (char *)sqliteMallocRaw(offset+max_space);
|
||||
if( !zData ){
|
||||
rc = SQLITE_NOMEM;
|
||||
goto abort_due_to_error;
|
||||
@ -2023,7 +2023,7 @@ case OP_Column: {
|
||||
** the serial types for the record. At the end of this block variable
|
||||
** offset is set to the offset to the start of Data0 in the record.
|
||||
*/
|
||||
aTypes = (u64 *)sqliteMalloc(sizeof(u64)*nFields);
|
||||
aTypes = (u64 *)sqliteMallocRaw(sizeof(u64)*nFields);
|
||||
if( !aTypes ){
|
||||
if( freeZdata ){
|
||||
sqliteFree(zData);
|
||||
@ -2058,7 +2058,7 @@ case OP_Column: {
|
||||
zData = (char *)sqlite3BtreeDataFetch(pCrsr, offset+len);
|
||||
}
|
||||
if( !zData && len>0 ){
|
||||
zData = (char *)sqliteMalloc(len);
|
||||
zData = (char *)sqliteMallocRaw(len);
|
||||
if( !zData ){
|
||||
sqliteFree(aTypes);
|
||||
rc = SQLITE_NOMEM;
|
||||
@ -2164,7 +2164,7 @@ case OP_MakeRecord: {
|
||||
}
|
||||
|
||||
/* Allocate space for the new record. */
|
||||
zNewRecord = sqliteMalloc(nBytes);
|
||||
zNewRecord = sqliteMallocRaw(nBytes);
|
||||
if( !zNewRecord ){
|
||||
rc = SQLITE_NOMEM;
|
||||
goto abort_due_to_error;
|
||||
@ -2304,7 +2304,7 @@ case OP_MakeIdxKey: {
|
||||
}
|
||||
|
||||
/* Allocate space for the new key */
|
||||
zKey = (char *)sqliteMalloc(nByte);
|
||||
zKey = (char *)sqliteMallocRaw(nByte);
|
||||
if( !zKey ){
|
||||
rc = SQLITE_NOMEM;
|
||||
goto abort_due_to_error;
|
||||
|
@ -1521,7 +1521,7 @@ int sqlite3VdbeIdxKeyCompare(
|
||||
|
||||
pCellKey = (unsigned char *)sqlite3BtreeKeyFetch(pCur, nCellKey);
|
||||
if( !pCellKey ){
|
||||
pCellKey = (unsigned char *)sqliteMalloc(nCellKey);
|
||||
pCellKey = (unsigned char *)sqliteMallocRaw(nCellKey);
|
||||
if( !pCellKey ){
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
@ -1547,6 +1547,3 @@ int sqlite3VdbeIdxKeyCompare(
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user