aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-10-31 14:53:32 +0000
committerdrh <drh@noemail.net>2014-10-31 14:53:32 +0000
commitca3e10ea37c4808fa84063f06b02229801b28cc0 (patch)
tree25f7d9b2ab4ff71311882bcee951b6e9ab1cb62f /src/analyze.c
parentbc2866ca7abc2ad7cbb6878d65cd18e584cff8f5 (diff)
parent0fb5daed34ba6f16d761b8ad02b944ec59cf5c03 (diff)
downloadsqlite-ca3e10ea37c4808fa84063f06b02229801b28cc0.tar.gz
sqlite-ca3e10ea37c4808fa84063f06b02229801b28cc0.zip
Merge recent trunk enhancements, and in particular the improvements to
the b-tree balancing logic, into the sessions branch. FossilOrigin-Name: 28b044a51215a3f64dafb2cf3b6cb7d2029580ef
Diffstat (limited to 'src/analyze.c')
-rw-r--r--src/analyze.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/analyze.c b/src/analyze.c
index 7d36f0131..597885237 100644
--- a/src/analyze.c
+++ b/src/analyze.c
@@ -1599,6 +1599,7 @@ static void initAvgEq(Index *pIdx){
nRow = pIdx->aiRowEst[0];
nDist100 = ((i64)100 * pIdx->aiRowEst[0]) / pIdx->aiRowEst[iCol+1];
}
+ pIdx->nRowEst0 = nRow;
/* Set nSum to the number of distinct (iCol+1) field prefixes that
** occur in the stat4 table for this index. Set sumEq to the sum of
@@ -1860,7 +1861,7 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
/* Load the statistics from the sqlite_stat4 table. */
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
- if( rc==SQLITE_OK ){
+ if( rc==SQLITE_OK && OptimizationEnabled(db, SQLITE_Stat34) ){
int lookasideEnabled = db->lookaside.bEnabled;
db->lookaside.bEnabled = 0;
rc = loadStat4(db, sInfo.zDatabase);