aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-02-22 20:42:15 +0000
committerdrh <>2023-02-22 20:42:15 +0000
commitbcb3215630380b2c0c4a62d19a13a12a192dfa02 (patch)
treea39b2d32b8a0374536e6d4c448b886aa9466725c /src
parentdbb32606278de2d90fb761cf79edc7d6820ef64e (diff)
downloadsqlite-bcb3215630380b2c0c4a62d19a13a12a192dfa02.tar.gz
sqlite-bcb3215630380b2c0c4a62d19a13a12a192dfa02.zip
Remove the push-down optimization restriction that was added by
check-in [1ad41840c5e0fa70] because it is no longer needed after the enhancements to compound query processing in check-in [27655c9353620aa5] This resolves the performance regression reported by [forum:/forumpost/bcc4375032|forum post bcc4375032]. FossilOrigin-Name: aa6bd6dff751223e302575c60f335707e4bb820bff716cab3706b564e18ed7ed
Diffstat (limited to 'src')
-rw-r--r--src/select.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/select.c b/src/select.c
index 1b5a1b506..23099b139 100644
--- a/src/select.c
+++ b/src/select.c
@@ -4238,8 +4238,7 @@ static int compoundHasDifferentAffinities(Select *p){
** query or there are no RIGHT or FULL JOINs in any arm
** of the subquery. (This is a duplicate of condition (27b).)
** (17h) The corresponding result set expressions in all arms of the
-** compound must have the same affinity. (See restriction (9)
-** on the push-down optimization.)
+** compound must have the same affinity.
**
** The parent and sub-query may contain WHERE clauses. Subject to
** rules (11), (13) and (14), they may also contain ORDER BY,
@@ -5107,10 +5106,6 @@ static int pushDownWindowCheck(Parse *pParse, Select *pSubq, Expr *pExpr){
** or EXCEPT, then all of the result set columns for all arms of
** the compound must use the BINARY collating sequence.
**
-** (9) If the subquery is a compound, then all arms of the compound must
-** have the same affinity. (This is the same as restriction (17h)
-** for query flattening.)
-**
**
** Return 0 if no changes are made and non-zero if one or more WHERE clause
** terms are duplicated into the subquery.
@@ -5141,9 +5136,6 @@ static int pushDownWhereTerms(
if( pSel->pWin ) return 0; /* restriction (6b) */
#endif
}
- if( compoundHasDifferentAffinities(pSubq) ){
- return 0; /* restriction (9) */
- }
if( notUnionAll ){
/* If any of the compound arms are connected using UNION, INTERSECT,
** or EXCEPT, then we must ensure that none of the columns use a