aboutsummaryrefslogtreecommitdiff
path: root/src/where.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/where.c')
-rw-r--r--src/where.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c
index 32fa61c7f..e20f2b301 100644
--- a/src/where.c
+++ b/src/where.c
@@ -5789,7 +5789,10 @@ WhereInfo *sqlite3WhereBegin(
}
#endif
/* Attempt to omit tables from the join that do not effect the result */
- if( pResultSet!=0 && pWInfo->nLevel>=2 ){
+ if( pWInfo->nLevel>=2
+ && pResultSet!=0
+ && OptimizationEnabled(db, SQLITE_OmitNoopJoin)
+ ){
Bitmask tabUsed = exprListTableUsage(pMaskSet, pResultSet);
if( pOrderBy ) tabUsed |= exprListTableUsage(pMaskSet, pOrderBy);
while( pWInfo->nLevel>=2 ){