Skip to content

Conversation

@xinyiZzz
Copy link
Contributor

Proposed changes

only allow select results to have only one row, such as:

  declare ret;
  select count(1) into ret from tbl;

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

@xinyiZzz
Copy link
Contributor Author

run buildall

Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@doris-robot
Copy link

TPC-H: Total hot run time: 37816 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9eb12a3998b0570b05f1967f6993c691cce62c60, data reload: false

------ Round 1 ----------------------------------
q1	17743	4091	4038	4038
q2	2045	138	129	129
q3	10674	937	930	930
q4	4678	909	937	909
q5	7628	2949	2979	2949
q6	180	121	119	119
q7	1222	755	748	748
q8	9319	2020	2023	2020
q9	7174	6262	6248	6248
q10	8185	2488	2522	2488
q11	421	209	203	203
q12	808	305	306	305
q13	17951	3206	3209	3206
q14	284	255	269	255
q15	527	491	492	491
q16	501	417	398	398
q17	922	868	863	863
q18	6699	6013	5939	5939
q19	1555	1503	1508	1503
q20	546	276	259	259
q21	7091	3523	3583	3523
q22	799	298	293	293
Total cold run time: 106952 ms
Total hot run time: 37816 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4027	4087	4009	4009
q2	304	214	215	214
q3	3002	2962	3010	2962
q4	1842	1829	1862	1829
q5	5191	5141	5166	5141
q6	199	114	112	112
q7	2147	1770	1752	1752
q8	3133	3228	3210	3210
q9	8295	8290	8327	8290
q10	6964	3801	3805	3801
q11	542	433	445	433
q12	709	591	610	591
q13	8902	3100	3096	3096
q14	286	277	279	277
q15	550	513	496	496
q16	516	513	487	487
q17	1713	1673	1667	1667
q18	8473	7542	7275	7275
q19	2099	1628	1622	1622
q20	2082	1894	1903	1894
q21	4765	4570	4710	4570
q22	506	458	448	448
Total cold run time: 66247 ms
Total hot run time: 54176 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 169236 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9eb12a3998b0570b05f1967f6993c691cce62c60, data reload: false

query1	931	343	330	330
query2	6552	1794	1708	1708
query3	6693	208	198	198
query4	23345	20689	20574	20574
query5	4314	364	358	358
query6	254	166	178	166
query7	4616	288	283	283
query8	253	187	193	187
query9	8494	2230	2228	2228
query10	413	223	212	212
query11	14544	14228	14048	14048
query12	131	81	84	81
query13	1644	436	417	417
query14	8415	6660	6190	6190
query15	204	171	182	171
query16	7077	258	261	258
query17	1045	518	489	489
query18	1897	277	269	269
query19	193	153	154	153
query20	87	80	86	80
query21	194	119	130	119
query22	4851	4652	4652	4652
query23	30523	29926	30019	29926
query24	10869	3042	3083	3042
query25	621	345	344	344
query26	1560	154	162	154
query27	3050	307	316	307
query28	7040	1831	1830	1830
query29	1100	554	560	554
query30	283	132	138	132
query31	855	676	696	676
query32	95	62	55	55
query33	717	232	220	220
query34	1048	472	485	472
query35	827	765	749	749
query36	923	852	886	852
query37	131	61	61	61
query38	3131	3033	2976	2976
query39	1334	1285	1254	1254
query40	273	102	105	102
query41	39	37	36	36
query42	101	101	97	97
query43	456	425	421	421
query44	1065	703	707	703
query45	189	181	174	174
query46	1049	802	797	797
query47	1463	1482	1483	1482
query48	430	346	337	337
query49	1148	307	298	298
query50	769	372	366	366
query51	4327	4246	4305	4246
query52	106	87	91	87
query53	333	269	265	265
query54	272	217	224	217
query55	85	80	77	77
query56	220	204	210	204
query57	958	870	911	870
query58	223	199	190	190
query59	2143	2105	2145	2105
query60	241	219	209	209
query61	83	92	83	83
query62	595	374	365	365
query63	290	259	251	251
query64	6147	2938	3087	2938
query65	3236	3209	3215	3209
query66	1132	312	311	311
query67	14348	14310	14164	14164
query68	4054	571	556	556
query69	527	373	384	373
query70	1224	1258	1211	1211
query71	321	252	244	244
query72	6037	2804	2695	2695
query73	713	314	328	314
query74	6273	6049	6043	6043
query75	3057	2440	2433	2433
query76	2678	1029	1131	1029
query77	352	233	230	230
query78	8992	8504	8454	8454
query79	2132	513	514	513
query80	1070	350	358	350
query81	492	199	199	199
query82	943	84	86	84
query83	238	127	120	120
query84	284	84	72	72
query85	1202	343	342	342
query86	419	292	305	292
query87	3308	3104	3075	3075
query88	2845	2262	2261	2261
query89	392	357	351	351
query90	1947	162	163	162
query91	148	124	123	123
query92	59	50	49	49
query93	1576	523	510	510
query94	1311	178	180	178
query95	437	340	349	340
query96	582	266	262	262
query97	4238	4193	4140	4140
query98	222	193	191	191
query99	1081	661	673	661
Total cold run time: 261129 ms
Total hot run time: 169236 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.11 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 9eb12a3998b0570b05f1967f6993c691cce62c60, data reload: false

query1	0.04	0.03	0.03
query2	0.06	0.02	0.02
query3	0.22	0.06	0.06
query4	1.67	0.10	0.10
query5	0.52	0.51	0.51
query6	1.36	0.67	0.67
query7	0.01	0.01	0.01
query8	0.03	0.03	0.03
query9	0.57	0.51	0.52
query10	0.57	0.57	0.56
query11	0.13	0.10	0.10
query12	0.12	0.11	0.10
query13	0.61	0.62	0.60
query14	0.81	0.80	0.81
query15	0.83	0.82	0.81
query16	0.37	0.37	0.38
query17	1.02	0.96	0.95
query18	0.26	0.25	0.25
query19	1.78	1.72	1.67
query20	0.02	0.01	0.01
query21	15.42	0.64	0.65
query22	3.42	3.37	2.04
query23	17.62	0.99	1.05
query24	2.16	0.36	0.21
query25	0.25	0.10	0.09
query26	0.14	0.14	0.13
query27	0.03	0.03	0.03
query28	12.55	0.85	0.84
query29	12.55	3.65	3.70
query30	0.53	0.54	0.48
query31	2.79	0.35	0.35
query32	3.35	0.48	0.48
query33	3.16	3.21	3.21
query34	15.34	4.76	4.75
query35	4.78	4.73	4.74
query36	1.13	1.08	1.07
query37	0.07	0.05	0.06
query38	0.04	0.02	0.03
query39	0.02	0.02	0.02
query40	0.17	0.13	0.16
query41	0.07	0.02	0.01
query42	0.02	0.02	0.01
query43	0.03	0.02	0.03
Total cold run time: 106.64 s
Total hot run time: 32.11 s

@doris-robot
Copy link

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit 9eb12a3998b0570b05f1967f6993c691cce62c60 with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          59 seconds loaded 1101869774 Bytes, about 17 MB/s
Stream load parquet:      31 seconds loaded 861443392 Bytes, about 26 MB/s
Insert into select:       18.0 seconds inserted 10000000 Rows, about 555K ops/s

: bulkCollectClause? INTO (tableRow | identifier) (COMMA (tableRow | identifier))*
;

bulkCollectClause :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this? not fount in desc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-optimization-and-tuning.html#GUID-19F50644-C88E-49AF-B31C-3EE4B4432714

The BULK COLLECT clause, a feature of bulk SQL, returns results from SQL to PL/SQL in batches rather than one at a time.

With the BULK COLLECT clause, each of the preceding statements retrieves an entire result set and stores it in one or more collection variables in a single operation (which is more efficient than using a loop statement to retrieve one result row at a time).

actually, this is not available yet, and there are still some problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doris PL-SQL docs, will be added later.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Feb 29, 2024
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit a15eef9 into apache:master Feb 29, 2024
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Dec 4, 2025
@morrySnow morrySnow mentioned this pull request Dec 4, 2025
16 tasks
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Dec 4, 2025
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Dec 5, 2025
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request Dec 5, 2025
yiguolei pushed a commit that referenced this pull request Dec 8, 2025
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants