mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Enhance the Btree object to remember whether or not it is holding an
Incrblob cursor. Use this knowledge to improve performance in the common case where it does not. FossilOrigin-Name: 476b11563c08c6d9c0abd69e4d865c4edcdd45f5
This commit is contained in:
15
src/btree.c
15
src/btree.c
@@ -490,13 +490,15 @@ static void invalidateIncrblobCursors(
|
||||
int isClearTable /* True if all rows are being deleted */
|
||||
){
|
||||
BtCursor *p;
|
||||
BtShared *pBt = pBtree->pBt;
|
||||
if( pBtree->hasIncrblobCur==0 ) return;
|
||||
assert( sqlite3BtreeHoldsMutex(pBtree) );
|
||||
for(p=pBt->pCursor; p; p=p->pNext){
|
||||
if( (p->curFlags & BTCF_Incrblob)!=0
|
||||
&& (isClearTable || p->info.nKey==iRow)
|
||||
){
|
||||
p->eState = CURSOR_INVALID;
|
||||
pBtree->hasIncrblobCur = 0;
|
||||
for(p=pBtree->pBt->pCursor; p; p=p->pNext){
|
||||
if( (p->curFlags & BTCF_Incrblob)!=0 ){
|
||||
pBtree->hasIncrblobCur = 1;
|
||||
if( isClearTable || p->info.nKey==iRow ){
|
||||
p->eState = CURSOR_INVALID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9450,6 +9452,7 @@ int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
|
||||
*/
|
||||
void sqlite3BtreeIncrblobCursor(BtCursor *pCur){
|
||||
pCur->curFlags |= BTCF_Incrblob;
|
||||
pCur->pBtree->hasIncrblobCur = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user