Set the TF_StatsUsed flag on tables when the query planner outcome is
affected by the sqlite_stat1 data. Also, change the column names of the
"PRAGMA stats" command so that they are not keywords.
FossilOrigin-Name: fb2b8ae8310e4ea4b42354bbf36c3084a9d5c6d7
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 6d58157..3c75f2f 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1883,10 +1883,13 @@
#define TF_Ephemeral 0x0002 /* An ephemeral table */
#define TF_HasPrimaryKey 0x0004 /* Table has a primary key */
#define TF_Autoincrement 0x0008 /* Integer primary key is autoincrement */
-#define TF_HasStat1 0x0010 /* Has STAT1 data */
+#define TF_HasStat1 0x0010 /* nRowLogEst set from sqlite_stat1 */
#define TF_WithoutRowid 0x0020 /* No rowid. PRIMARY KEY is the key */
#define TF_NoVisibleRowid 0x0040 /* No user-visible "rowid" column */
#define TF_OOOHidden 0x0080 /* Out-of-Order hidden columns */
+#define TF_SizeChng 0x0100 /* nRowLogEst might be inaccurate */
+#define TF_StatsUsed 0x0200 /* Query planner decisions affected by
+ ** Index.aiRowLogEst[] values */
/*
** Test to see whether or not a table is a virtual table. This is
@@ -2129,7 +2132,7 @@
unsigned isResized:1; /* True if resizeIndexObject() has been called */
unsigned isCovering:1; /* True if this is a covering index */
unsigned noSkipScan:1; /* Do not try to use skip-scan if true */
- unsigned hasStat1:1; /* True if stat1 data has been loaded */
+ unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
int nSample; /* Number of elements in aSample[] */
int nSampleCol; /* Size of IndexSample.anEq[] and so on */