mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
More tweaks to improve the performance of the insert logic, slightly.
FossilOrigin-Name: dec1307581216e01ad508ffe4455b957e3356654
This commit is contained in:
19
src/btree.c
19
src/btree.c
@@ -6096,24 +6096,23 @@ static int fillInCell(
|
||||
|
||||
/* Fill in the header. */
|
||||
nHeader = pPage->childPtrSize;
|
||||
nPayload = pX->nData + pX->nZero;
|
||||
if( pPage->intKeyLeaf ){
|
||||
if( pPage->intKey ){
|
||||
nPayload = pX->nData + pX->nZero;
|
||||
pSrc = pX->pData;
|
||||
nSrc = pX->nData;
|
||||
assert( pPage->intKeyLeaf ); /* fillInCell() only called for leaves */
|
||||
nHeader += putVarint32(&pCell[nHeader], nPayload);
|
||||
nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
|
||||
}else{
|
||||
assert( pX->nData==0 );
|
||||
assert( pX->nZero==0 );
|
||||
}
|
||||
nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
|
||||
|
||||
/* Fill in the payload */
|
||||
if( pPage->intKey ){
|
||||
pSrc = pX->pData;
|
||||
nSrc = pX->nData;
|
||||
}else{
|
||||
assert( pX->nKey<=0x7fffffff && pX->pKey!=0 );
|
||||
nSrc = nPayload = (int)pX->nKey;
|
||||
pSrc = pX->pKey;
|
||||
nHeader += putVarint32(&pCell[nHeader], nPayload);
|
||||
}
|
||||
|
||||
/* Fill in the payload */
|
||||
if( nPayload<=pPage->maxLocal ){
|
||||
n = nHeader + nPayload;
|
||||
testcase( n==3 );
|
||||
|
Reference in New Issue
Block a user