Use the estimated number of rows computed for subqueries in the cost
computations for outer queries.
FossilOrigin-Name: 56bbc539246a6dc9f1ae1edb898db7a4f6f6d322
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index b9eb650..c02a0e4 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1947,6 +1947,7 @@
int nLevel; /* Number of nested loop */
struct WhereClause *pWC; /* Decomposition of the WHERE clause */
double savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
+ double nRowOut; /* Estimated number of output rows */
WhereLevel a[1]; /* Information about each nest loop in WHERE */
};
@@ -2022,6 +2023,7 @@
Expr *pOffset; /* OFFSET expression. NULL means not used. */
int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */
int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */
+ double nSelectRow; /* Estimated number of result rows */
};
/*