aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
diff options
context:
space:
mode:
authordrh <>2024-02-20 12:48:00 +0000
committerdrh <>2024-02-20 12:48:00 +0000
commit68d92c4ad3342a97ae523574cb8e09d1043970a5 (patch)
tree0f6ed269e065b93243259a7ea02a8ff9db3cf516 /src/btree.c
parente0a9935be1c506646566f6b7845eb381bb219e16 (diff)
parent4189c44cff384341fb2a7780a7b5b35c734db9af (diff)
downloadsqlite-68d92c4ad3342a97ae523574cb8e09d1043970a5.tar.gz
sqlite-68d92c4ad3342a97ae523574cb8e09d1043970a5.zip
Enhancements to PRAGMA optimize and ANALYZE. Add the 0x10000 flag to
PRAGMA optimize. ANALYZE now records zero-size partial indexes in the sqlite_stat1 table. PRAGMA optimize looks for both growth and shrinkage in table sizes, and uses tighter bounds (10x rather than 25x) to trigger a re-analyze. PRAGMA optimize automatically uses are reasonable analysis_limit to prevent excessive runtimes. FossilOrigin-Name: 63ef234e88857a653fa3541e80d59802ceccb806ac8296e8bae79a385b7086f7
Diffstat (limited to 'src/btree.c')
-rw-r--r--src/btree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/btree.c b/src/btree.c
index 49c07c81a..16b683abe 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -6182,10 +6182,10 @@ i64 sqlite3BtreeRowCountEst(BtCursor *pCur){
assert( cursorOwnsBtShared(pCur) );
assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
- /* Currently this interface is only called by the OP_IfSmaller
- ** opcode, and it that case the cursor will always be valid and
- ** will always point to a leaf node. */
- if( NEVER(pCur->eState!=CURSOR_VALID) ) return -1;
+ /* Currently this interface is only called by the OP_IfSizeBetween
+ ** opcode and the OP_Count opcode with P3=1. In either case,
+ ** the cursor will always be valid unless the btree is empty. */
+ if( pCur->eState!=CURSOR_VALID ) return 0;
if( NEVER(pCur->pPage->leaf==0) ) return -1;
n = pCur->pPage->nCell;