mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
The analyze_as_needed pragma now responds to table size growth and will
automatically rerun the analysis after each 10x size increase. FossilOrigin-Name: bfbdd07409688fac4ccddbab3639745f6152e23d
This commit is contained in:
19
src/btree.c
19
src/btree.c
@@ -5319,6 +5319,25 @@ int sqlite3BtreeEof(BtCursor *pCur){
|
||||
return (CURSOR_VALID!=pCur->eState);
|
||||
}
|
||||
|
||||
/*
|
||||
** Return an estimate for the number of rows in the table that pCur is
|
||||
** pointing to. Return a negative number if no estimate is currently
|
||||
** available.
|
||||
*/
|
||||
i64 sqlite3BtreeRowCountEst(BtCursor *pCur){
|
||||
i64 n;
|
||||
u8 i;
|
||||
|
||||
assert( cursorOwnsBtShared(pCur) );
|
||||
assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
|
||||
if( pCur->eState!=CURSOR_VALID ) return -1;
|
||||
if( pCur->apPage[pCur->iPage-1]->leaf==0 ) return -1;
|
||||
for(n=1, i=0; i<pCur->iPage; i++){
|
||||
n *= pCur->apPage[i]->nCell;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
** Advance the cursor to the next entry in the database. If
|
||||
** successful then set *pRes=0. If the cursor
|
||||
|
Reference in New Issue
Block a user