Remove the restriction on the number of entries per index in sqlite_stat3.
FossilOrigin-Name: 374343c8ad53829c4ad715ed623d16635797de9a
diff --git a/src/analyze.c b/src/analyze.c
index b1af3bf..b98968a 100644
--- a/src/analyze.c
+++ b/src/analyze.c
@@ -970,12 +970,10 @@
zIndex = (char *)sqlite3_column_text(pStmt, 0);
if( zIndex==0 ) continue;
nSample = sqlite3_column_int(pStmt, 1);
- if( nSample>255 ) continue;
pIdx = sqlite3FindIndex(db, zIndex, zDb);
if( pIdx==0 ) continue;
assert( pIdx->nSample==0 );
- testcase( nSample==255 );
- pIdx->nSample = (u8)nSample;
+ pIdx->nSample = nSample;
pIdx->aSample = sqlite3MallocZero( nSample*sizeof(IndexSample) );
pIdx->avgEq = pIdx->aiRowEst[1];
if( pIdx->aSample==0 ){
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 6f92a1a..35ab54a 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1501,13 +1501,13 @@
u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */
u8 bUnordered; /* Use this index for == or IN queries only */
- u8 nSample; /* Number of elements in aSample[] */
char *zColAff; /* String defining the affinity of each column */
Index *pNext; /* The next index associated with the same table */
Schema *pSchema; /* Schema containing this index */
u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */
char **azColl; /* Array of collation sequence names for index */
#ifdef SQLITE_ENABLE_STAT3
+ int nSample; /* Number of elements in aSample[] */
tRowcnt avgEq; /* Average nEq value for key values not in aSample */
IndexSample *aSample; /* Samples of the left-most key */
#endif