diff options
author | drh <> | 2024-02-16 12:57:04 +0000 |
---|---|---|
committer | drh <> | 2024-02-16 12:57:04 +0000 |
commit | 9d00aba8959abc5ea57360d43e8160fb6136c663 (patch) | |
tree | f2516f68dde54d6dbe57885563d8d0431396cb4b /src | |
parent | 5e5831a760e066318f0a63e0665dae7aa39afe6c (diff) | |
download | sqlite-9d00aba8959abc5ea57360d43e8160fb6136c663.tar.gz sqlite-9d00aba8959abc5ea57360d43e8160fb6136c663.zip |
Rename the TF_StatsUsed flag to TF_MaybeReanalyze, to more accurately
reflect its usage. No logic changes.
FossilOrigin-Name: b4790da5e0d6f0f617e6c3a17fc2606842e41cab14339392abd335410fec0aa3
Diffstat (limited to 'src')
-rw-r--r-- | src/pragma.c | 2 | ||||
-rw-r--r-- | src/sqliteInt.h | 3 | ||||
-rw-r--r-- | src/where.c | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/pragma.c b/src/pragma.c index a1243acc1..872177e13 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -2450,7 +2450,7 @@ void sqlite3Pragma( /* If table pTab has not been used in a way that would benefit from ** having analysis statistics during the current session, then skip it. ** This also has the effect of skipping virtual tables and views */ - if( (pTab->tabFlags & TF_StatsUsed)==0 ) continue; + if( (pTab->tabFlags & TF_MaybeReanalyze)==0 ) continue; /* Reanalyze if the table is 25 times larger than the last analysis */ szThreshold = pTab->nRowLogEst + 46; assert( sqlite3LogEst(25)==46 ); diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 9d9657f3c..1c1055f42 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2476,8 +2476,7 @@ struct Table { #define TF_HasStored 0x00000040 /* Has one or more STORED columns */ #define TF_HasGenerated 0x00000060 /* Combo: HasVirtual + HasStored */ #define TF_WithoutRowid 0x00000080 /* No rowid. PRIMARY KEY is the key */ -#define TF_StatsUsed 0x00000100 /* Query planner decisions affected by - ** Index.aiRowLogEst[] values */ +#define TF_MaybeReanalyze 0x00000100 /* Maybe run ANALYZE on this table */ #define TF_NoVisibleRowid 0x00000200 /* No user-visible "rowid" column */ #define TF_OOOHidden 0x00000400 /* Out-of-Order hidden columns */ #define TF_HasNotNull 0x00000800 /* Contains NOT NULL constraints */ diff --git a/src/where.c b/src/where.c index 65022a65b..0e526b337 100644 --- a/src/where.c +++ b/src/where.c @@ -3970,7 +3970,7 @@ static int whereLoopAddBtree( ** unique index is used (making the index functionally non-unique) ** then the sqlite_stat1 data becomes important for scoring the ** plan */ - pTab->tabFlags |= TF_StatsUsed; + pTab->tabFlags |= TF_MaybeReanalyze; } #ifdef SQLITE_ENABLE_STAT4 sqlite3Stat4ProbeFree(pBuilder->pRec); @@ -5805,7 +5805,7 @@ static SQLITE_NOINLINE void whereCheckIfBloomFilterIsUseful( SrcItem *pItem = &pWInfo->pTabList->a[pLoop->iTab]; Table *pTab = pItem->pTab; if( (pTab->tabFlags & TF_HasStat1)==0 ) break; - pTab->tabFlags |= TF_StatsUsed; + pTab->tabFlags |= TF_MaybeReanalyze; if( i>=1 && (pLoop->wsFlags & reqFlags)==reqFlags /* vvvvvv--- Always the case if WHERE_COLUMN_EQ is defined */ |