1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Take the LIMIT clause into account when estimating the cost of sorting.

FossilOrigin-Name: d491745cab951e0de70f1f79b7640ea8aff6e8bb
This commit is contained in:
drh
2016-02-25 16:04:59 +00:00
parent d8c22ac655
commit c3489bbf77
7 changed files with 93 additions and 59 deletions

View File

@@ -412,6 +412,7 @@ struct WhereInfo {
WhereLoop *pLoops; /* List of all WhereLoop objects */
Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
LogEst nRowOut; /* Estimated number of output rows */
LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */
u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */
i8 nOBSat; /* Number of ORDER BY terms satisfied by indices */
u8 sorted; /* True if really sorted (not just grouped) */