aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2024-02-20 12:14:07 +0000
committerdrh <>2024-02-20 12:14:07 +0000
commit4189c44cff384341fb2a7780a7b5b35c734db9af (patch)
treeaf9b25f9fd9230582cc9e7370202ff47826a4591 /src
parentae71fa5d59fa9da292770ec3d14b1f330c079e79 (diff)
downloadsqlite-4189c44cff384341fb2a7780a7b5b35c734db9af.tar.gz
sqlite-4189c44cff384341fb2a7780a7b5b35c734db9af.zip
Another simplification of the PRAGMA optimize logic for improved coverage.
FossilOrigin-Name: 6c5a0c85454e3c658e51fab611c169c034447174022eebc52fd8619b528a4765
Diffstat (limited to 'src')
-rw-r--r--src/pragma.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pragma.c b/src/pragma.c
index ca34e80af..877fb3f72 100644
--- a/src/pragma.c
+++ b/src/pragma.c
@@ -2557,16 +2557,15 @@ void sqlite3Pragma(
/* Reanalyze if the table is 10 times larger or smaller than
** the last analysis. Unconditional reanalysis if there are
** unanalyzed indexes. */
+ sqlite3OpenTable(pParse, iTabCur, iDb, pTab, OP_OpenRead);
if( szThreshold>=0 ){
const LogEst iRange = 33; /* 10x size change */
- sqlite3OpenTable(pParse, iTabCur, iDb, pTab, OP_OpenRead);
sqlite3VdbeAddOp4Int(v, OP_IfSizeBetween, iTabCur,
sqlite3VdbeCurrentAddr(v)+2+(opMask&1),
szThreshold>=iRange ? szThreshold-iRange : -1,
szThreshold+iRange);
VdbeCoverage(v);
- }else if( !hasStat1 ){
- sqlite3OpenTable(pParse, iTabCur, iDb, pTab, OP_OpenRead);
+ }else{
sqlite3VdbeAddOp2(v, OP_Rewind, iTabCur,
sqlite3VdbeCurrentAddr(v)+2+(opMask&1));
VdbeCoverage(v);