SQLite

Check-in [dec1307581]
Login

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

Overview
Comment:More tweaks to improve the performance of the insert logic, slightly.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dec1307581216e01ad508ffe4455b957e3356654
User & Date: drh 2016-05-21 23:25:29.377
Context
2016-05-23
00:10
Update the configure script with additional hints on the location of tclConfig.sh, hints needed by the latest versions of Xcode. (check-in: 90411a2816 user: drh tags: trunk)
2016-05-21
23:25
More tweaks to improve the performance of the insert logic, slightly. (check-in: dec1307581 user: drh tags: trunk)
20:03
Simplify the sqlite3BtreeInsert() interface by gathering the five arguments describing the content to be inserted into the new BtreePayload structure, and thus reducing the number of parameters from eight to four. (check-in: 55f348cdd2 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
6092
6093
6094
6095
6096
6097
6098

6099


6100
6101

6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115

6116


6117
6118
6119
6120
6121
6122
6123
  /* pPage is not necessarily writeable since pCell might be auxiliary
  ** buffer space that is separate from the pPage buffer area */
  assert( pCell<pPage->aData || pCell>=&pPage->aData[pBt->pageSize]
            || sqlite3PagerIswriteable(pPage->pDbPage) );

  /* Fill in the header. */
  nHeader = pPage->childPtrSize;

  nPayload = pX->nData + pX->nZero;


  if( pPage->intKeyLeaf ){
    nHeader += putVarint32(&pCell[nHeader], nPayload);

  }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;

  }


  if( nPayload<=pPage->maxLocal ){
    n = nHeader + nPayload;
    testcase( n==3 );
    testcase( n==4 );
    if( n<4 ) n = 4;
    *pnSize = n;
    spaceLeft = nPayload;







>
|
>
>
|

>



<
<
<
<
<
<
<
<



>

>
>







6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108








6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
  /* pPage is not necessarily writeable since pCell might be auxiliary
  ** buffer space that is separate from the pPage buffer area */
  assert( pCell<pPage->aData || pCell>=&pPage->aData[pBt->pageSize]
            || sqlite3PagerIswriteable(pPage->pDbPage) );

  /* Fill in the header. */
  nHeader = pPage->childPtrSize;
  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 );








    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 );
    testcase( n==4 );
    if( n<4 ) n = 4;
    *pnSize = n;
    spaceLeft = nPayload;