You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "924060929 (via GitHub)" <gi...@apache.org> on 2024/10/30 06:15:38 UTC

[PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

924060929 opened a new pull request, #42897:
URL: https://github.com/apache/doris/pull/42897

   ## Proposed changes
   
   fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2446107479

   
   <details>
   <summary>ClickBench: <b>Total hot run time: 33.7 s</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
   ClickBench test result on commit 00bdabe909492d70e574032ae4d963c01f8a0120, data reload: false
   
   query1	0.04	0.03	0.03
   query2	0.07	0.03	0.03
   query3	0.24	0.06	0.06
   query4	1.63	0.10	0.10
   query5	0.41	0.39	0.41
   query6	1.16	0.65	0.66
   query7	0.02	0.03	0.02
   query8	0.04	0.04	0.02
   query9	0.56	0.49	0.50
   query10	0.54	0.54	0.55
   query11	0.14	0.10	0.11
   query12	0.14	0.12	0.10
   query13	0.60	0.59	0.60
   query14	2.71	2.73	2.75
   query15	0.90	0.83	0.82
   query16	0.38	0.39	0.38
   query17	0.96	1.05	1.07
   query18	0.20	0.20	0.20
   query19	2.03	1.90	1.96
   query20	0.02	0.01	0.01
   query21	15.38	0.62	0.56
   query22	2.79	3.02	2.63
   query23	16.89	0.83	0.78
   query24	2.82	1.48	1.28
   query25	0.14	0.04	0.14
   query26	0.65	0.14	0.14
   query27	0.04	0.04	0.03
   query28	10.22	1.09	1.07
   query29	12.52	3.29	3.30
   query30	0.24	0.07	0.06
   query31	2.85	0.39	0.38
   query32	3.27	0.46	0.45
   query33	3.02	3.02	3.06
   query34	17.09	4.46	4.48
   query35	4.49	4.51	4.52
   query36	0.66	0.51	0.48
   query37	0.08	0.06	0.06
   query38	0.04	0.04	0.03
   query39	0.03	0.03	0.02
   query40	0.15	0.13	0.13
   query41	0.08	0.03	0.02
   query42	0.04	0.03	0.02
   query43	0.04	0.03	0.03
   Total cold run time: 106.32 s
   Total hot run time: 33.7 s
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "924060929 (via GitHub)" <gi...@apache.org>.
924060929 commented on code in PR #42897:
URL: https://github.com/apache/doris/pull/42897#discussion_r1822038414


##########
regression-test/suites/nereids_syntax_p0/slow_fold_constant_case_when.groovy:
##########
@@ -0,0 +1,824 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("slow_fold_constant_case_when") {
+    sql "drop table if exists slow_fold_constant_case_when"
+
+    sql """
+        CREATE TABLE `slow_fold_constant_case_when` (
+          `c1` decimal(38,10) NULL,
+          `c2` decimal(38,10) NULL,
+          `c3` decimal(38,10) NULL,
+          `c4` decimal(38,10) NULL,
+          `c5` decimal(38,10) NULL,
+          `c6` decimal(38,10) NULL,
+          `c7` decimal(38,10) NULL,
+          `c8` decimal(38,10) NULL,
+          `c9` decimal(38,10) NULL,
+          `c10` decimal(38,10) NULL,
+          `c11` decimal(38,10) NULL,
+          `c12` decimal(38,10) NULL,
+          `c13` decimal(38,10) NULL,
+          `c14` decimal(38,10) NULL,
+          `c15` decimal(38,10) NULL,
+          `c16` decimal(38,10) NULL,
+          `c17` decimal(38,10) NULL,
+          `c18` decimal(38,10) NULL,
+          `c19` decimal(38,10) NULL,
+          `c20` decimal(38,10) NULL,
+          `c21` decimal(38,10) NULL,
+          `c22` decimal(38,10) NULL,
+          `c23` decimal(38,10) NULL,
+          `c24` decimal(38,10) NULL,
+          `c25` decimal(38,10) NULL,
+          `c26` decimal(38,10) NULL,
+          `c27` decimal(38,10) NULL,
+          `c28` decimal(38,10) NULL,
+          `c29` decimal(38,10) NULL,
+          `c30` decimal(38,10) NULL,
+          `c31` decimal(38,10) NULL,
+          `c32` decimal(38,10) NULL,
+          `c33` decimal(38,10) NULL,
+          `c34` decimal(38,10) NULL,
+          `c35` decimal(38,10) NULL,
+          `c36` decimal(38,10) NULL,
+          `c37` decimal(38,10) NULL,
+          `c38` decimal(38,10) NULL,
+          `c39` decimal(38,10) NULL,
+          `c40` decimal(38,10) NULL,
+          `c41` decimal(38,10) NULL,
+          `c42` decimal(38,10) NULL,
+          `c43` varchar(65532) NULL,
+          `c44` varchar(65532) NULL,
+          `c45` varchar(65532) NULL,
+          `c46` varchar(65532) NULL,
+          `c47` varchar(65532) NULL,
+          `c48` varchar(65532) NULL,
+          `c49` varchar(65532) NULL,
+          `c50` varchar(65532) NULL,
+          `c51` varchar(65532) NULL,
+          `c52` varchar(65532) NULL,
+          `c53` varchar(65532) NULL,
+          `c54` varchar(65532) NULL,
+          `c55` varchar(65532) NULL,
+          `c56` varchar(65532) NULL,
+          `c57` varchar(65532) NULL,
+          `c58` varchar(65532) NULL,
+          `c59` varchar(65532) NULL,
+          `c60` varchar(65532) NULL,
+          `c61` varchar(65532) NULL,
+          `c62` varchar(65532) NULL,
+          `c63` varchar(65532) NULL,
+          `c64` varchar(65532) NULL,
+          `c65` varchar(65532) NULL,
+          `c66` varchar(65532) NULL,
+          `c67` varchar(65532) NULL,
+          `c68` varchar(65532) NULL,
+          `c69` varchar(65532) NULL,
+          `c70` varchar(65532) NULL,
+          `c71` varchar(65532) NULL,
+          `c72` varchar(65532) NULL,
+          `c73` varchar(65532) NULL,
+          `c74` varchar(65532) NOT NULL,
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`c1`, `c2`)
+        PARTITION BY LIST(`c74`)
+        (PARTITION P_201901 VALUES IN ("201901"),
+        PARTITION P_201902 VALUES IN ("201902"),
+        PARTITION P_201903 VALUES IN ("201903"),
+        PARTITION P_201904 VALUES IN ("201904"),
+        PARTITION P_201905 VALUES IN ("201905"),
+        PARTITION P_201906 VALUES IN ("201906"),
+        PARTITION P_201907 VALUES IN ("201907"),
+        PARTITION P_201908 VALUES IN ("201908"),
+        PARTITION P_201909 VALUES IN ("201909"),
+        PARTITION P_201910 VALUES IN ("201910"),
+        PARTITION P_201911 VALUES IN ("201911"),
+        PARTITION P_201912 VALUES IN ("201912"),
+        PARTITION P_202000 VALUES IN ("202000"),
+        PARTITION P_202001 VALUES IN ("202001"),
+        PARTITION P_202002 VALUES IN ("202002"),
+        PARTITION P_202003 VALUES IN ("202003"),
+        PARTITION P_202004 VALUES IN ("202004"),
+        PARTITION P_202005 VALUES IN ("202005"),
+        PARTITION P_202006 VALUES IN ("202006"),
+        PARTITION P_202007 VALUES IN ("202007"),
+        PARTITION P_202008 VALUES IN ("202008"),
+        PARTITION P_202009 VALUES IN ("202009"),
+        PARTITION P_202010 VALUES IN ("202010"),
+        PARTITION P_202011 VALUES IN ("202011"),
+        PARTITION P_202012 VALUES IN ("202012"),
+        PARTITION P_202100 VALUES IN ("202100"),
+        PARTITION P_202101 VALUES IN ("202101"),
+        PARTITION P_202102 VALUES IN ("202102"),
+        PARTITION P_202103 VALUES IN ("202103"),
+        PARTITION P_202104 VALUES IN ("202104"),
+        PARTITION P_202105 VALUES IN ("202105"),
+        PARTITION P_202106 VALUES IN ("202106"),
+        PARTITION P_202107 VALUES IN ("202107"),
+        PARTITION P_202108 VALUES IN ("202108"),
+        PARTITION P_202109 VALUES IN ("202109"),
+        PARTITION P_202110 VALUES IN ("202110"),
+        PARTITION P_202111 VALUES IN ("202111"),
+        PARTITION P_202112 VALUES IN ("202112"),
+        PARTITION P_202201 VALUES IN ("202201"),
+        PARTITION P_202202 VALUES IN ("202202"),
+        PARTITION P_202203 VALUES IN ("202203"),
+        PARTITION P_202204 VALUES IN ("202204"),
+        PARTITION P_202205 VALUES IN ("202205"),
+        PARTITION P_202206 VALUES IN ("202206"),
+        PARTITION P_202207 VALUES IN ("202207"),
+        PARTITION P_202208 VALUES IN ("202208"),
+        PARTITION P_202209 VALUES IN ("202209"),
+        PARTITION P_202210 VALUES IN ("202210"),
+        PARTITION P_202211 VALUES IN ("202211"),
+        PARTITION P_202212 VALUES IN ("202212"),
+        PARTITION P_202300 VALUES IN ("202300"),
+        PARTITION P_202301 VALUES IN ("202301"),
+        PARTITION P_202302 VALUES IN ("202302"),
+        PARTITION P_202303 VALUES IN ("202303"),
+        PARTITION P_202304 VALUES IN ("202304"),
+        PARTITION P_202305 VALUES IN ("202305"),
+        PARTITION P_202306 VALUES IN ("202306"),
+        PARTITION P_202307 VALUES IN ("202307"),
+        PARTITION P_202308 VALUES IN ("202308"),
+        PARTITION P_202309 VALUES IN ("202309"),
+        PARTITION P_202310 VALUES IN ("202310"),
+        PARTITION P_202311 VALUES IN ("202311"),
+        PARTITION P_202312 VALUES IN ("202312"),
+        PARTITION P_202401 VALUES IN ("202401"),
+        PARTITION P_202402 VALUES IN ("202402"),
+        PARTITION P_202403 VALUES IN ("202403"),
+        PARTITION P_202404 VALUES IN ("202404"),
+        PARTITION P_202405 VALUES IN ("202405"),
+        PARTITION P_202406 VALUES IN ("202406"),
+        PARTITION P_202407 VALUES IN ("202407"),
+        PARTITION P_202408 VALUES IN ("202408"),
+        PARTITION P_202409 VALUES IN ("202409"))
+        DISTRIBUTED BY HASH(`c44`) BUCKETS 3
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+        );
+        """
+
+
+    def sqlStr = """
+                SELECT `_____` ,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         (c22)/(((c39)+(c40))/2) AS `_____` ,
+         ((c39)+(c40))/2 AS `_______`
+FROM 
+    (SELECT sum(c22) AS `c22` ,
+         sum(c16) AS `c16` ,
+         sum(c6) AS `c6` ,
+         sum(c26) AS `c26` ,
+         sum(c10) AS `c10` ,
+         sum(c19) AS `c19` ,
+         sum(c17) AS `c17` ,
+         sum(c39) AS `c39` ,
+         sum(c21) AS `c21` ,
+         sum(c12) AS `c12` ,
+         sum(c5) AS `c5` ,
+         sum(c11) AS `c11` ,
+         sum(c4) AS `c4` ,
+         sum(c27) AS `c27` ,
+         sum(c29) AS `c29` ,
+         sum(c20) AS `c20` ,
+         sum(c28) AS `c28` ,
+         sum(c13) AS `c13` ,
+         sum(c25) AS `c25` ,
+         sum(c9) AS `c9` ,
+         sum(c24) AS `c24` ,
+         sum(c14) AS `c14` ,
+         sum(c40) AS `c40` ,
+         sum(c7) AS `c7` ,
+         sum(c15) AS `c15` ,
+         sum(c18) AS `c18` ,
+         sum(c8) AS `c8` ,
+         `_____`
+    FROM 
+        (SELECT `_____` ,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         `c22` ,
+         `c39` ,
+         `c40`
+        FROM 
+            (SELECT array ( `_______0` ) AS _______temp,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         `c22` ,
+         `c39` ,
+         `c40`
+            FROM ( select
+                CASE
+                WHEN c57 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE '______'
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END AS `_______0` , sum(c24) AS `c24` , sum(c28) AS `c28` , sum(c26) AS `c26` , sum(c21) AS `c21` , sum(c25) AS `c25` , sum(c29) AS `c29` , sum(c5) AS `c5` , sum(c6) AS `c6` , sum(c7) AS `c7` , sum(c15) AS `c15` , sum(c4) AS `c4` , sum(c27) AS `c27` , sum(c19) AS `c19` , sum(c18) AS `c18` , sum(c20) AS `c20` , sum(c8) AS `c8` , sum(c13) AS `c13` , sum(c16) AS `c16` , sum(c11) AS `c11` , sum(c10) AS `c10` , sum(c14) AS `c14` , sum(c9) AS `c9` , sum(c12) AS `c12` , sum(c17) AS `c17` , sum(c22)c22 , sum(c39)c39 , sum(c40)c40
+            FROM slow_fold_constant_case_when
+            WHERE slow_fold_constant_case_when.`c43` IN ('______')
+                    AND (( ((`c72` IN ('______'))
+                    OR (`c73` IN ('______'))))
+                    OR (`c63` IN ('______')))
+            GROUP BY  _______0 limit 3000 ) t ) t lateral view explode ( `_______temp` ) c0 AS _____
+            WHERE _____ is NOT null
+                    AND _____ != '______' ) t
+            GROUP BY  grouping sets((_____) ,())
+            ORDER BY  _____ nulls last limit 3000 ) t
+        ORDER BY  _____ nulls last
+            """
+
+    sql "set enable_fold_constant_by_be=false"
+    test {
+        sql sqlStr
+        time 60000

Review Comment:
   It should be fast, so we don't need to move to p1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2445982956

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2446083110

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 41304 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 00bdabe909492d70e574032ae4d963c01f8a0120, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	17622	7493	7297	7297
   q2	2048	162	171	162
   q3	10553	1151	1148	1148
   q4	10231	874	787	787
   q5	7773	3183	3113	3113
   q6	238	151	150	150
   q7	1035	608	610	608
   q8	9614	1983	2024	1983
   q9	8026	6456	6495	6456
   q10	7147	2457	2412	2412
   q11	449	250	246	246
   q12	499	216	208	208
   q13	17777	3028	3044	3028
   q14	246	216	217	216
   q15	575	515	519	515
   q16	657	582	574	574
   q17	990	618	495	495
   q18	7374	6720	6636	6636
   q19	1346	1042	926	926
   q20	479	176	177	176
   q21	4030	3165	3173	3165
   q22	1137	1028	1003	1003
   Total cold run time: 109846 ms
   Total hot run time: 41304 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	7292	7266	7241	7241
   q2	330	224	220	220
   q3	2990	2747	2756	2747
   q4	1968	1704	1681	1681
   q5	5461	5517	5515	5515
   q6	214	136	138	136
   q7	2144	1722	1719	1719
   q8	3234	3387	3410	3387
   q9	8645	8593	8606	8593
   q10	3523	3499	3461	3461
   q11	586	491	476	476
   q12	774	577	602	577
   q13	3808	3083	3041	3041
   q14	294	270	262	262
   q15	574	512	496	496
   q16	669	620	640	620
   q17	1878	1607	1564	1564
   q18	7750	7570	7561	7561
   q19	1673	1626	1607	1607
   q20	2091	1808	1802	1802
   q21	5441	5290	5339	5290
   q22	1136	1025	1001	1001
   Total cold run time: 62475 ms
   Total hot run time: 58997 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2448935172

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "starocean999 (via GitHub)" <gi...@apache.org>.
starocean999 merged PR #42897:
URL: https://github.com/apache/doris/pull/42897


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2448938204

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2445961194

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)
   
   Since 2024-03-18, the Document has been moved to [doris-website](https://github.com/apache/doris-website).
   See [Doris Document](https://cwiki.apache.org/confluence/display/DORIS/Doris+Document).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "924060929 (via GitHub)" <gi...@apache.org>.
924060929 commented on code in PR #42897:
URL: https://github.com/apache/doris/pull/42897#discussion_r1822038414


##########
regression-test/suites/nereids_syntax_p0/slow_fold_constant_case_when.groovy:
##########
@@ -0,0 +1,824 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("slow_fold_constant_case_when") {
+    sql "drop table if exists slow_fold_constant_case_when"
+
+    sql """
+        CREATE TABLE `slow_fold_constant_case_when` (
+          `c1` decimal(38,10) NULL,
+          `c2` decimal(38,10) NULL,
+          `c3` decimal(38,10) NULL,
+          `c4` decimal(38,10) NULL,
+          `c5` decimal(38,10) NULL,
+          `c6` decimal(38,10) NULL,
+          `c7` decimal(38,10) NULL,
+          `c8` decimal(38,10) NULL,
+          `c9` decimal(38,10) NULL,
+          `c10` decimal(38,10) NULL,
+          `c11` decimal(38,10) NULL,
+          `c12` decimal(38,10) NULL,
+          `c13` decimal(38,10) NULL,
+          `c14` decimal(38,10) NULL,
+          `c15` decimal(38,10) NULL,
+          `c16` decimal(38,10) NULL,
+          `c17` decimal(38,10) NULL,
+          `c18` decimal(38,10) NULL,
+          `c19` decimal(38,10) NULL,
+          `c20` decimal(38,10) NULL,
+          `c21` decimal(38,10) NULL,
+          `c22` decimal(38,10) NULL,
+          `c23` decimal(38,10) NULL,
+          `c24` decimal(38,10) NULL,
+          `c25` decimal(38,10) NULL,
+          `c26` decimal(38,10) NULL,
+          `c27` decimal(38,10) NULL,
+          `c28` decimal(38,10) NULL,
+          `c29` decimal(38,10) NULL,
+          `c30` decimal(38,10) NULL,
+          `c31` decimal(38,10) NULL,
+          `c32` decimal(38,10) NULL,
+          `c33` decimal(38,10) NULL,
+          `c34` decimal(38,10) NULL,
+          `c35` decimal(38,10) NULL,
+          `c36` decimal(38,10) NULL,
+          `c37` decimal(38,10) NULL,
+          `c38` decimal(38,10) NULL,
+          `c39` decimal(38,10) NULL,
+          `c40` decimal(38,10) NULL,
+          `c41` decimal(38,10) NULL,
+          `c42` decimal(38,10) NULL,
+          `c43` varchar(65532) NULL,
+          `c44` varchar(65532) NULL,
+          `c45` varchar(65532) NULL,
+          `c46` varchar(65532) NULL,
+          `c47` varchar(65532) NULL,
+          `c48` varchar(65532) NULL,
+          `c49` varchar(65532) NULL,
+          `c50` varchar(65532) NULL,
+          `c51` varchar(65532) NULL,
+          `c52` varchar(65532) NULL,
+          `c53` varchar(65532) NULL,
+          `c54` varchar(65532) NULL,
+          `c55` varchar(65532) NULL,
+          `c56` varchar(65532) NULL,
+          `c57` varchar(65532) NULL,
+          `c58` varchar(65532) NULL,
+          `c59` varchar(65532) NULL,
+          `c60` varchar(65532) NULL,
+          `c61` varchar(65532) NULL,
+          `c62` varchar(65532) NULL,
+          `c63` varchar(65532) NULL,
+          `c64` varchar(65532) NULL,
+          `c65` varchar(65532) NULL,
+          `c66` varchar(65532) NULL,
+          `c67` varchar(65532) NULL,
+          `c68` varchar(65532) NULL,
+          `c69` varchar(65532) NULL,
+          `c70` varchar(65532) NULL,
+          `c71` varchar(65532) NULL,
+          `c72` varchar(65532) NULL,
+          `c73` varchar(65532) NULL,
+          `c74` varchar(65532) NOT NULL,
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`c1`, `c2`)
+        PARTITION BY LIST(`c74`)
+        (PARTITION P_201901 VALUES IN ("201901"),
+        PARTITION P_201902 VALUES IN ("201902"),
+        PARTITION P_201903 VALUES IN ("201903"),
+        PARTITION P_201904 VALUES IN ("201904"),
+        PARTITION P_201905 VALUES IN ("201905"),
+        PARTITION P_201906 VALUES IN ("201906"),
+        PARTITION P_201907 VALUES IN ("201907"),
+        PARTITION P_201908 VALUES IN ("201908"),
+        PARTITION P_201909 VALUES IN ("201909"),
+        PARTITION P_201910 VALUES IN ("201910"),
+        PARTITION P_201911 VALUES IN ("201911"),
+        PARTITION P_201912 VALUES IN ("201912"),
+        PARTITION P_202000 VALUES IN ("202000"),
+        PARTITION P_202001 VALUES IN ("202001"),
+        PARTITION P_202002 VALUES IN ("202002"),
+        PARTITION P_202003 VALUES IN ("202003"),
+        PARTITION P_202004 VALUES IN ("202004"),
+        PARTITION P_202005 VALUES IN ("202005"),
+        PARTITION P_202006 VALUES IN ("202006"),
+        PARTITION P_202007 VALUES IN ("202007"),
+        PARTITION P_202008 VALUES IN ("202008"),
+        PARTITION P_202009 VALUES IN ("202009"),
+        PARTITION P_202010 VALUES IN ("202010"),
+        PARTITION P_202011 VALUES IN ("202011"),
+        PARTITION P_202012 VALUES IN ("202012"),
+        PARTITION P_202100 VALUES IN ("202100"),
+        PARTITION P_202101 VALUES IN ("202101"),
+        PARTITION P_202102 VALUES IN ("202102"),
+        PARTITION P_202103 VALUES IN ("202103"),
+        PARTITION P_202104 VALUES IN ("202104"),
+        PARTITION P_202105 VALUES IN ("202105"),
+        PARTITION P_202106 VALUES IN ("202106"),
+        PARTITION P_202107 VALUES IN ("202107"),
+        PARTITION P_202108 VALUES IN ("202108"),
+        PARTITION P_202109 VALUES IN ("202109"),
+        PARTITION P_202110 VALUES IN ("202110"),
+        PARTITION P_202111 VALUES IN ("202111"),
+        PARTITION P_202112 VALUES IN ("202112"),
+        PARTITION P_202201 VALUES IN ("202201"),
+        PARTITION P_202202 VALUES IN ("202202"),
+        PARTITION P_202203 VALUES IN ("202203"),
+        PARTITION P_202204 VALUES IN ("202204"),
+        PARTITION P_202205 VALUES IN ("202205"),
+        PARTITION P_202206 VALUES IN ("202206"),
+        PARTITION P_202207 VALUES IN ("202207"),
+        PARTITION P_202208 VALUES IN ("202208"),
+        PARTITION P_202209 VALUES IN ("202209"),
+        PARTITION P_202210 VALUES IN ("202210"),
+        PARTITION P_202211 VALUES IN ("202211"),
+        PARTITION P_202212 VALUES IN ("202212"),
+        PARTITION P_202300 VALUES IN ("202300"),
+        PARTITION P_202301 VALUES IN ("202301"),
+        PARTITION P_202302 VALUES IN ("202302"),
+        PARTITION P_202303 VALUES IN ("202303"),
+        PARTITION P_202304 VALUES IN ("202304"),
+        PARTITION P_202305 VALUES IN ("202305"),
+        PARTITION P_202306 VALUES IN ("202306"),
+        PARTITION P_202307 VALUES IN ("202307"),
+        PARTITION P_202308 VALUES IN ("202308"),
+        PARTITION P_202309 VALUES IN ("202309"),
+        PARTITION P_202310 VALUES IN ("202310"),
+        PARTITION P_202311 VALUES IN ("202311"),
+        PARTITION P_202312 VALUES IN ("202312"),
+        PARTITION P_202401 VALUES IN ("202401"),
+        PARTITION P_202402 VALUES IN ("202402"),
+        PARTITION P_202403 VALUES IN ("202403"),
+        PARTITION P_202404 VALUES IN ("202404"),
+        PARTITION P_202405 VALUES IN ("202405"),
+        PARTITION P_202406 VALUES IN ("202406"),
+        PARTITION P_202407 VALUES IN ("202407"),
+        PARTITION P_202408 VALUES IN ("202408"),
+        PARTITION P_202409 VALUES IN ("202409"))
+        DISTRIBUTED BY HASH(`c44`) BUCKETS 3
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+        );
+        """
+
+
+    def sqlStr = """
+                SELECT `_____` ,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         (c22)/(((c39)+(c40))/2) AS `_____` ,
+         ((c39)+(c40))/2 AS `_______`
+FROM 
+    (SELECT sum(c22) AS `c22` ,
+         sum(c16) AS `c16` ,
+         sum(c6) AS `c6` ,
+         sum(c26) AS `c26` ,
+         sum(c10) AS `c10` ,
+         sum(c19) AS `c19` ,
+         sum(c17) AS `c17` ,
+         sum(c39) AS `c39` ,
+         sum(c21) AS `c21` ,
+         sum(c12) AS `c12` ,
+         sum(c5) AS `c5` ,
+         sum(c11) AS `c11` ,
+         sum(c4) AS `c4` ,
+         sum(c27) AS `c27` ,
+         sum(c29) AS `c29` ,
+         sum(c20) AS `c20` ,
+         sum(c28) AS `c28` ,
+         sum(c13) AS `c13` ,
+         sum(c25) AS `c25` ,
+         sum(c9) AS `c9` ,
+         sum(c24) AS `c24` ,
+         sum(c14) AS `c14` ,
+         sum(c40) AS `c40` ,
+         sum(c7) AS `c7` ,
+         sum(c15) AS `c15` ,
+         sum(c18) AS `c18` ,
+         sum(c8) AS `c8` ,
+         `_____`
+    FROM 
+        (SELECT `_____` ,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         `c22` ,
+         `c39` ,
+         `c40`
+        FROM 
+            (SELECT array ( `_______0` ) AS _______temp,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         `c22` ,
+         `c39` ,
+         `c40`
+            FROM ( select
+                CASE
+                WHEN c57 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE '______'
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END AS `_______0` , sum(c24) AS `c24` , sum(c28) AS `c28` , sum(c26) AS `c26` , sum(c21) AS `c21` , sum(c25) AS `c25` , sum(c29) AS `c29` , sum(c5) AS `c5` , sum(c6) AS `c6` , sum(c7) AS `c7` , sum(c15) AS `c15` , sum(c4) AS `c4` , sum(c27) AS `c27` , sum(c19) AS `c19` , sum(c18) AS `c18` , sum(c20) AS `c20` , sum(c8) AS `c8` , sum(c13) AS `c13` , sum(c16) AS `c16` , sum(c11) AS `c11` , sum(c10) AS `c10` , sum(c14) AS `c14` , sum(c9) AS `c9` , sum(c12) AS `c12` , sum(c17) AS `c17` , sum(c22)c22 , sum(c39)c39 , sum(c40)c40
+            FROM slow_fold_constant_case_when
+            WHERE slow_fold_constant_case_when.`c43` IN ('______')
+                    AND (( ((`c72` IN ('______'))
+                    OR (`c73` IN ('______'))))
+                    OR (`c63` IN ('______')))
+            GROUP BY  _______0 limit 3000 ) t ) t lateral view explode ( `_______temp` ) c0 AS _____
+            WHERE _____ is NOT null
+                    AND _____ != '______' ) t
+            GROUP BY  grouping sets((_____) ,())
+            ORDER BY  _____ nulls last limit 3000 ) t
+        ORDER BY  _____ nulls last
+            """
+
+    sql "set enable_fold_constant_by_be=false"
+    test {
+        sql sqlStr
+        time 60000

Review Comment:
   It should be fast(200ms), so we don't need to move to p1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "924060929 (via GitHub)" <gi...@apache.org>.
924060929 commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2446056592

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on code in PR #42897:
URL: https://github.com/apache/doris/pull/42897#discussion_r1822036822


##########
regression-test/suites/nereids_syntax_p0/slow_fold_constant_case_when.groovy:
##########
@@ -0,0 +1,824 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("slow_fold_constant_case_when") {
+    sql "drop table if exists slow_fold_constant_case_when"
+
+    sql """
+        CREATE TABLE `slow_fold_constant_case_when` (
+          `c1` decimal(38,10) NULL,
+          `c2` decimal(38,10) NULL,
+          `c3` decimal(38,10) NULL,
+          `c4` decimal(38,10) NULL,
+          `c5` decimal(38,10) NULL,
+          `c6` decimal(38,10) NULL,
+          `c7` decimal(38,10) NULL,
+          `c8` decimal(38,10) NULL,
+          `c9` decimal(38,10) NULL,
+          `c10` decimal(38,10) NULL,
+          `c11` decimal(38,10) NULL,
+          `c12` decimal(38,10) NULL,
+          `c13` decimal(38,10) NULL,
+          `c14` decimal(38,10) NULL,
+          `c15` decimal(38,10) NULL,
+          `c16` decimal(38,10) NULL,
+          `c17` decimal(38,10) NULL,
+          `c18` decimal(38,10) NULL,
+          `c19` decimal(38,10) NULL,
+          `c20` decimal(38,10) NULL,
+          `c21` decimal(38,10) NULL,
+          `c22` decimal(38,10) NULL,
+          `c23` decimal(38,10) NULL,
+          `c24` decimal(38,10) NULL,
+          `c25` decimal(38,10) NULL,
+          `c26` decimal(38,10) NULL,
+          `c27` decimal(38,10) NULL,
+          `c28` decimal(38,10) NULL,
+          `c29` decimal(38,10) NULL,
+          `c30` decimal(38,10) NULL,
+          `c31` decimal(38,10) NULL,
+          `c32` decimal(38,10) NULL,
+          `c33` decimal(38,10) NULL,
+          `c34` decimal(38,10) NULL,
+          `c35` decimal(38,10) NULL,
+          `c36` decimal(38,10) NULL,
+          `c37` decimal(38,10) NULL,
+          `c38` decimal(38,10) NULL,
+          `c39` decimal(38,10) NULL,
+          `c40` decimal(38,10) NULL,
+          `c41` decimal(38,10) NULL,
+          `c42` decimal(38,10) NULL,
+          `c43` varchar(65532) NULL,
+          `c44` varchar(65532) NULL,
+          `c45` varchar(65532) NULL,
+          `c46` varchar(65532) NULL,
+          `c47` varchar(65532) NULL,
+          `c48` varchar(65532) NULL,
+          `c49` varchar(65532) NULL,
+          `c50` varchar(65532) NULL,
+          `c51` varchar(65532) NULL,
+          `c52` varchar(65532) NULL,
+          `c53` varchar(65532) NULL,
+          `c54` varchar(65532) NULL,
+          `c55` varchar(65532) NULL,
+          `c56` varchar(65532) NULL,
+          `c57` varchar(65532) NULL,
+          `c58` varchar(65532) NULL,
+          `c59` varchar(65532) NULL,
+          `c60` varchar(65532) NULL,
+          `c61` varchar(65532) NULL,
+          `c62` varchar(65532) NULL,
+          `c63` varchar(65532) NULL,
+          `c64` varchar(65532) NULL,
+          `c65` varchar(65532) NULL,
+          `c66` varchar(65532) NULL,
+          `c67` varchar(65532) NULL,
+          `c68` varchar(65532) NULL,
+          `c69` varchar(65532) NULL,
+          `c70` varchar(65532) NULL,
+          `c71` varchar(65532) NULL,
+          `c72` varchar(65532) NULL,
+          `c73` varchar(65532) NULL,
+          `c74` varchar(65532) NOT NULL,
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`c1`, `c2`)
+        PARTITION BY LIST(`c74`)
+        (PARTITION P_201901 VALUES IN ("201901"),
+        PARTITION P_201902 VALUES IN ("201902"),
+        PARTITION P_201903 VALUES IN ("201903"),
+        PARTITION P_201904 VALUES IN ("201904"),
+        PARTITION P_201905 VALUES IN ("201905"),
+        PARTITION P_201906 VALUES IN ("201906"),
+        PARTITION P_201907 VALUES IN ("201907"),
+        PARTITION P_201908 VALUES IN ("201908"),
+        PARTITION P_201909 VALUES IN ("201909"),
+        PARTITION P_201910 VALUES IN ("201910"),
+        PARTITION P_201911 VALUES IN ("201911"),
+        PARTITION P_201912 VALUES IN ("201912"),
+        PARTITION P_202000 VALUES IN ("202000"),
+        PARTITION P_202001 VALUES IN ("202001"),
+        PARTITION P_202002 VALUES IN ("202002"),
+        PARTITION P_202003 VALUES IN ("202003"),
+        PARTITION P_202004 VALUES IN ("202004"),
+        PARTITION P_202005 VALUES IN ("202005"),
+        PARTITION P_202006 VALUES IN ("202006"),
+        PARTITION P_202007 VALUES IN ("202007"),
+        PARTITION P_202008 VALUES IN ("202008"),
+        PARTITION P_202009 VALUES IN ("202009"),
+        PARTITION P_202010 VALUES IN ("202010"),
+        PARTITION P_202011 VALUES IN ("202011"),
+        PARTITION P_202012 VALUES IN ("202012"),
+        PARTITION P_202100 VALUES IN ("202100"),
+        PARTITION P_202101 VALUES IN ("202101"),
+        PARTITION P_202102 VALUES IN ("202102"),
+        PARTITION P_202103 VALUES IN ("202103"),
+        PARTITION P_202104 VALUES IN ("202104"),
+        PARTITION P_202105 VALUES IN ("202105"),
+        PARTITION P_202106 VALUES IN ("202106"),
+        PARTITION P_202107 VALUES IN ("202107"),
+        PARTITION P_202108 VALUES IN ("202108"),
+        PARTITION P_202109 VALUES IN ("202109"),
+        PARTITION P_202110 VALUES IN ("202110"),
+        PARTITION P_202111 VALUES IN ("202111"),
+        PARTITION P_202112 VALUES IN ("202112"),
+        PARTITION P_202201 VALUES IN ("202201"),
+        PARTITION P_202202 VALUES IN ("202202"),
+        PARTITION P_202203 VALUES IN ("202203"),
+        PARTITION P_202204 VALUES IN ("202204"),
+        PARTITION P_202205 VALUES IN ("202205"),
+        PARTITION P_202206 VALUES IN ("202206"),
+        PARTITION P_202207 VALUES IN ("202207"),
+        PARTITION P_202208 VALUES IN ("202208"),
+        PARTITION P_202209 VALUES IN ("202209"),
+        PARTITION P_202210 VALUES IN ("202210"),
+        PARTITION P_202211 VALUES IN ("202211"),
+        PARTITION P_202212 VALUES IN ("202212"),
+        PARTITION P_202300 VALUES IN ("202300"),
+        PARTITION P_202301 VALUES IN ("202301"),
+        PARTITION P_202302 VALUES IN ("202302"),
+        PARTITION P_202303 VALUES IN ("202303"),
+        PARTITION P_202304 VALUES IN ("202304"),
+        PARTITION P_202305 VALUES IN ("202305"),
+        PARTITION P_202306 VALUES IN ("202306"),
+        PARTITION P_202307 VALUES IN ("202307"),
+        PARTITION P_202308 VALUES IN ("202308"),
+        PARTITION P_202309 VALUES IN ("202309"),
+        PARTITION P_202310 VALUES IN ("202310"),
+        PARTITION P_202311 VALUES IN ("202311"),
+        PARTITION P_202312 VALUES IN ("202312"),
+        PARTITION P_202401 VALUES IN ("202401"),
+        PARTITION P_202402 VALUES IN ("202402"),
+        PARTITION P_202403 VALUES IN ("202403"),
+        PARTITION P_202404 VALUES IN ("202404"),
+        PARTITION P_202405 VALUES IN ("202405"),
+        PARTITION P_202406 VALUES IN ("202406"),
+        PARTITION P_202407 VALUES IN ("202407"),
+        PARTITION P_202408 VALUES IN ("202408"),
+        PARTITION P_202409 VALUES IN ("202409"))
+        DISTRIBUTED BY HASH(`c44`) BUCKETS 3
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+        );
+        """
+
+
+    def sqlStr = """
+                SELECT `_____` ,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         (c22)/(((c39)+(c40))/2) AS `_____` ,
+         ((c39)+(c40))/2 AS `_______`
+FROM 
+    (SELECT sum(c22) AS `c22` ,
+         sum(c16) AS `c16` ,
+         sum(c6) AS `c6` ,
+         sum(c26) AS `c26` ,
+         sum(c10) AS `c10` ,
+         sum(c19) AS `c19` ,
+         sum(c17) AS `c17` ,
+         sum(c39) AS `c39` ,
+         sum(c21) AS `c21` ,
+         sum(c12) AS `c12` ,
+         sum(c5) AS `c5` ,
+         sum(c11) AS `c11` ,
+         sum(c4) AS `c4` ,
+         sum(c27) AS `c27` ,
+         sum(c29) AS `c29` ,
+         sum(c20) AS `c20` ,
+         sum(c28) AS `c28` ,
+         sum(c13) AS `c13` ,
+         sum(c25) AS `c25` ,
+         sum(c9) AS `c9` ,
+         sum(c24) AS `c24` ,
+         sum(c14) AS `c14` ,
+         sum(c40) AS `c40` ,
+         sum(c7) AS `c7` ,
+         sum(c15) AS `c15` ,
+         sum(c18) AS `c18` ,
+         sum(c8) AS `c8` ,
+         `_____`
+    FROM 
+        (SELECT `_____` ,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         `c22` ,
+         `c39` ,
+         `c40`
+        FROM 
+            (SELECT array ( `_______0` ) AS _______temp,
+         `c24` ,
+         `c28` ,
+         `c26` ,
+         `c21` ,
+         `c25` ,
+         `c29` ,
+         `c5` ,
+         `c6` ,
+         `c7` ,
+         `c15` ,
+         `c4` ,
+         `c27` ,
+         `c19` ,
+         `c18` ,
+         `c20` ,
+         `c8` ,
+         `c13` ,
+         `c16` ,
+         `c11` ,
+         `c10` ,
+         `c14` ,
+         `c9` ,
+         `c12` ,
+         `c17` ,
+         `c22` ,
+         `c39` ,
+         `c40`
+            FROM ( select
+                CASE
+                WHEN c57 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c63 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c73 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE (
+                CASE
+                WHEN c72 = '______' THEN
+                '______'
+                ELSE '______'
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END )
+                END AS `_______0` , sum(c24) AS `c24` , sum(c28) AS `c28` , sum(c26) AS `c26` , sum(c21) AS `c21` , sum(c25) AS `c25` , sum(c29) AS `c29` , sum(c5) AS `c5` , sum(c6) AS `c6` , sum(c7) AS `c7` , sum(c15) AS `c15` , sum(c4) AS `c4` , sum(c27) AS `c27` , sum(c19) AS `c19` , sum(c18) AS `c18` , sum(c20) AS `c20` , sum(c8) AS `c8` , sum(c13) AS `c13` , sum(c16) AS `c16` , sum(c11) AS `c11` , sum(c10) AS `c10` , sum(c14) AS `c14` , sum(c9) AS `c9` , sum(c12) AS `c12` , sum(c17) AS `c17` , sum(c22)c22 , sum(c39)c39 , sum(c40)c40
+            FROM slow_fold_constant_case_when
+            WHERE slow_fold_constant_case_when.`c43` IN ('______')
+                    AND (( ((`c72` IN ('______'))
+                    OR (`c73` IN ('______'))))
+                    OR (`c63` IN ('______')))
+            GROUP BY  _______0 limit 3000 ) t ) t lateral view explode ( `_______temp` ) c0 AS _____
+            WHERE _____ is NOT null
+                    AND _____ != '______' ) t
+            GROUP BY  grouping sets((_____) ,())
+            ORDER BY  _____ nulls last limit 3000 ) t
+        ORDER BY  _____ nulls last
+            """
+
+    sql "set enable_fold_constant_by_be=false"
+    test {
+        sql sqlStr
+        time 60000

Review Comment:
   is it acceptable in P0 rather than P1?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2445982910

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "924060929 (via GitHub)" <gi...@apache.org>.
924060929 commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2445961325

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2446042737

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 41166 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 5de74988f0f712e57a0539cee845fbcbc208aafc, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	17576	7392	7260	7260
   q2	2033	162	156	156
   q3	10638	1104	1157	1104
   q4	10559	836	803	803
   q5	7761	3068	3081	3068
   q6	234	142	142	142
   q7	1045	602	605	602
   q8	9348	1938	2037	1938
   q9	6499	6449	6472	6449
   q10	7114	2433	2409	2409
   q11	456	253	248	248
   q12	409	214	204	204
   q13	17825	2994	2993	2993
   q14	244	227	212	212
   q15	571	503	512	503
   q16	663	580	582	580
   q17	967	601	538	538
   q18	7341	6601	6779	6601
   q19	1343	1053	1034	1034
   q20	478	183	186	183
   q21	3945	3142	3277	3142
   q22	1115	1019	997	997
   Total cold run time: 108164 ms
   Total hot run time: 41166 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	7341	7287	7234	7234
   q2	327	227	235	227
   q3	2934	2930	2932	2930
   q4	2065	1869	1796	1796
   q5	5726	5790	5754	5754
   q6	227	140	142	140
   q7	2208	1851	1799	1799
   q8	3324	3558	3436	3436
   q9	8970	8957	8908	8908
   q10	3587	3566	3557	3557
   q11	588	482	478	478
   q12	848	625	628	625
   q13	9967	3214	3171	3171
   q14	308	275	272	272
   q15	584	530	522	522
   q16	720	653	652	652
   q17	1856	1603	1614	1603
   q18	8269	7743	7537	7537
   q19	1699	1637	1592	1592
   q20	2127	1874	1847	1847
   q21	5606	5468	5334	5334
   q22	1133	1023	1036	1023
   Total cold run time: 70414 ms
   Total hot run time: 60437 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fi](Nerieds) fix FoldConstantRuleOnFE too slow when CaseWhen clause nesting multiple layers [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42897:
URL: https://github.com/apache/doris/pull/42897#issuecomment-2446099592

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 191264 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit 00bdabe909492d70e574032ae4d963c01f8a0120, data reload: false
   
   query1	971	385	367	367
   query2	6497	2085	1985	1985
   query3	6732	217	227	217
   query4	33543	23707	23565	23565
   query5	3559	444	423	423
   query6	257	168	162	162
   query7	4471	288	292	288
   query8	294	215	217	215
   query9	9428	2726	2687	2687
   query10	426	263	246	246
   query11	18152	15228	15320	15228
   query12	157	102	103	102
   query13	1604	435	416	416
   query14	9328	6933	6844	6844
   query15	203	177	173	173
   query16	6746	465	471	465
   query17	1087	561	551	551
   query18	1862	295	300	295
   query19	379	153	155	153
   query20	115	115	107	107
   query21	158	106	103	103
   query22	4620	4157	4282	4157
   query23	34688	34200	34073	34073
   query24	11214	2736	2775	2736
   query25	658	399	388	388
   query26	1504	158	160	158
   query27	2833	287	279	279
   query28	7943	2471	2434	2434
   query29	961	423	425	423
   query30	332	168	165	165
   query31	1004	803	832	803
   query32	102	58	61	58
   query33	786	270	268	268
   query34	1001	505	520	505
   query35	1043	889	902	889
   query36	1115	941	939	939
   query37	136	77	74	74
   query38	4427	4289	4263	4263
   query39	1502	1417	1417	1417
   query40	246	103	103	103
   query41	49	48	45	45
   query42	107	98	96	96
   query43	542	493	490	490
   query44	1247	817	815	815
   query45	180	166	164	164
   query46	1133	723	704	704
   query47	1955	1862	1884	1862
   query48	437	316	327	316
   query49	1215	396	391	391
   query50	814	380	388	380
   query51	7223	6943	6912	6912
   query52	101	91	91	91
   query53	260	182	177	177
   query54	1314	413	412	412
   query55	79	81	81	81
   query56	276	240	260	240
   query57	1277	1201	1194	1194
   query58	247	226	215	215
   query59	3344	2944	2998	2944
   query60	289	259	282	259
   query61	116	98	99	98
   query62	867	667	673	667
   query63	217	180	185	180
   query64	4880	632	607	607
   query65	3290	3181	3214	3181
   query66	1420	308	307	307
   query67	16293	15731	15787	15731
   query68	4799	548	556	548
   query69	421	261	254	254
   query70	1171	1145	1164	1145
   query71	387	254	242	242
   query72	6254	3967	4046	3967
   query73	753	354	356	354
   query74	10278	8989	9061	8989
   query75	3408	2662	2683	2662
   query76	2913	1083	1111	1083
   query77	405	269	262	262
   query78	10414	9669	9495	9495
   query79	1379	598	597	597
   query80	956	432	417	417
   query81	558	237	237	237
   query82	978	115	115	115
   query83	217	138	132	132
   query84	283	71	68	68
   query85	1303	316	282	282
   query86	369	272	299	272
   query87	4963	4626	4759	4626
   query88	3455	2186	2139	2139
   query89	394	287	291	287
   query90	1988	185	182	182
   query91	131	107	97	97
   query92	57	54	53	53
   query93	1085	547	539	539
   query94	963	262	285	262
   query95	341	239	246	239
   query96	612	277	273	273
   query97	2900	2743	2671	2671
   query98	210	195	205	195
   query99	1535	1297	1307	1297
   Total cold run time: 297136 ms
   Total hot run time: 191264 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org