aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-06-21 00:35:37 +0000
committerdrh <drh@noemail.net>2013-06-21 00:35:37 +0000
commit6457a353bca93d55db6011df34fb04e8c81e997e (patch)
tree63598016fa00c08918b923cb91eda6cce62c2b0d /src/select.c
parent472eae8a4d4d69895e85234aff425fdc835957ff (diff)
downloadsqlite-6457a353bca93d55db6011df34fb04e8c81e997e.tar.gz
sqlite-6457a353bca93d55db6011df34fb04e8c81e997e.zip
Modify the query planner interface so that it always passes in the result set.
This is the first step toward adding an optimization that will omit tables from a join that do not contribute to the result. FossilOrigin-Name: 2c2577e69ccb47f1af674a755e71221e2ca0b322
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/select.c b/src/select.c
index 40b7ec86f..fa35f4587 100644
--- a/src/select.c
+++ b/src/select.c
@@ -4261,15 +4261,16 @@ int sqlite3Select(
if( !isAgg && pGroupBy==0 ){
/* No aggregate functions and no GROUP BY clause */
- ExprList *pDist = (sDistinct.isTnct ? p->pEList : 0);
+ u16 wctrlFlags = (sDistinct.isTnct ? WHERE_WANT_DISTINCT : 0);
/* Begin the database scan. */
- pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, pOrderBy, pDist, 0,0);
+ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, pOrderBy, p->pEList,
+ wctrlFlags, 0);
if( pWInfo==0 ) goto select_end;
if( sqlite3WhereOutputRowCount(pWInfo) < p->nSelectRow ){
p->nSelectRow = sqlite3WhereOutputRowCount(pWInfo);
}
- if( sqlite3WhereIsDistinct(pWInfo) ){
+ if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){
sDistinct.eTnctType = sqlite3WhereIsDistinct(pWInfo);
}
if( pOrderBy && sqlite3WhereIsOrdered(pWInfo) ) pOrderBy = 0;