Skip to content

Conversation

Vallishp
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

support display previous query id.

mysql> select LAST_QUERY_ID();
No connection. Trying to reconnect...
Connection id: 0
Current database: *** NONE ***

+-----------------+
| last_query_id() |
+-----------------+
| Not Available |
+-----------------+
1 row in set (0.08 sec)

mysql> select LAST_QUERY_ID();
+-----------------------------------+
| last_query_id() |
+-----------------------------------+
| e133f2641e0a411c-b73f1f6c67bedcf9 |
+-----------------------------------+
1 row in set (0.01 sec)

mysql>

@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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@Vallishp
Copy link
Contributor Author

run buildall

@@ -322,6 +322,7 @@ KILL: 'KILL';
LABEL: 'LABEL';
LARGEINT: 'LARGEINT';
LAST: 'LAST';
LAST_QUERY_ID: 'LAST_QUERY_ID';
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we should not support use this function without parentheses, so add this to keyword list is not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. updated

@@ -879,6 +883,10 @@ public TUniqueId queryId() {
return queryId;
}

public TUniqueId getLastQuerId() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public TUniqueId getLastQuerId() {
public TUniqueId getLastQueryId() {

@Vallishp Vallishp force-pushed the support_last_query_id branch from e9e36aa to 2e74ecf Compare September 12, 2024 09:09
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17581	4256	4215	4215
q2	2038	183	183	183
q3	10478	1244	1380	1244
q4	10531	965	1035	965
q5	7713	3144	3169	3144
q6	226	140	139	139
q7	1031	633	628	628
q8	9455	2008	2019	2008
q9	6775	6269	6328	6269
q10	7022	2523	2490	2490
q11	430	253	255	253
q12	417	240	247	240
q13	17752	3046	3046	3046
q14	286	254	256	254
q15	540	499	485	485
q16	519	440	425	425
q17	982	939	940	939
q18	7761	6841	6724	6724
q19	1382	1228	1225	1225
q20	608	332	324	324
q21	3894	3551	3650	3551
q22	1089	982	991	982
Total cold run time: 108510 ms
Total hot run time: 39733 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4249	4186	4137	4137
q2	344	232	231	231
q3	2891	2888	2910	2888
q4	1985	1943	1981	1943
q5	5731	5719	5788	5719
q6	234	138	134	134
q7	2133	1830	1787	1787
q8	3332	3377	3432	3377
q9	8805	8803	8822	8803
q10	3533	3671	3622	3622
q11	604	480	479	479
q12	814	651	641	641
q13	8412	3200	3199	3199
q14	317	298	277	277
q15	546	498	515	498
q16	497	467	461	461
q17	1785	1740	1719	1719
q18	8543	8157	7998	7998
q19	1777	1737	1733	1733
q20	2107	1921	1878	1878
q21	5966	5814	5802	5802
q22	1129	1010	1012	1010
Total cold run time: 65734 ms
Total hot run time: 58336 ms

@Vallishp
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18186	7844	7362	7362
q2	2450	206	214	206
q3	11365	1436	1364	1364
q4	10277	1099	1095	1095
q5	8394	3291	3211	3211
q6	247	156	162	156
q7	1079	655	646	646
q8	9622	2088	2087	2087
q9	6915	6359	6335	6335
q10	7092	2566	2515	2515
q11	436	255	260	255
q12	421	232	223	223
q13	17765	3026	3043	3026
q14	301	253	258	253
q15	584	548	526	526
q16	532	425	421	421
q17	1007	978	957	957
q18	7522	6880	6838	6838
q19	1390	1260	1244	1244
q20	628	357	341	341
q21	3908	3545	3532	3532
q22	1076	1025	1017	1017
Total cold run time: 111197 ms
Total hot run time: 43610 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7261	7282	7271	7271
q2	337	239	231	231
q3	2962	2900	2917	2900
q4	1957	1957	1961	1957
q5	5464	5444	5433	5433
q6	235	148	147	147
q7	2084	1666	1687	1666
q8	3243	3353	3336	3336
q9	8421	8432	8416	8416
q10	3432	3477	3471	3471
q11	582	478	462	462
q12	757	598	586	586
q13	6203	3034	3054	3034
q14	297	274	274	274
q15	570	518	525	518
q16	492	447	461	447
q17	1763	1708	1720	1708
q18	8145	7750	7636	7636
q19	1736	1715	1714	1714
q20	2039	1848	1814	1814
q21	5555	5421	5567	5421
q22	1116	1014	1017	1014
Total cold run time: 64651 ms
Total hot run time: 59456 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 195561 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 2e74ecfd2004ef7cad47c6a6dc2668a77673519b, data reload: false

query1	915	379	387	379
query2	6526	1867	1789	1789
query3	6670	216	218	216
query4	26226	24081	23837	23837
query5	5224	540	529	529
query6	277	178	172	172
query7	4595	312	308	308
query8	289	228	240	228
query9	8491	2632	2631	2631
query10	464	284	285	284
query11	16082	15702	15578	15578
query12	171	105	102	102
query13	1681	396	379	379
query14	11314	7134	6922	6922
query15	217	175	209	175
query16	7562	486	457	457
query17	1510	554	551	551
query18	1876	287	279	279
query19	191	143	159	143
query20	117	109	109	109
query21	215	102	101	101
query22	4583	4517	4336	4336
query23	34445	33578	33669	33578
query24	9780	3099	3108	3099
query25	632	379	406	379
query26	726	151	153	151
query27	2181	276	283	276
query28	5925	2156	2108	2108
query29	888	409	408	408
query30	293	154	151	151
query31	988	771	761	761
query32	102	59	58	58
query33	739	293	294	293
query34	922	475	496	475
query35	884	755	718	718
query36	1077	908	896	896
query37	147	87	83	83
query38	3994	4036	3946	3946
query39	1506	1418	1379	1379
query40	208	114	114	114
query41	48	48	45	45
query42	122	98	98	98
query43	506	457	439	439
query44	1289	797	781	781
query45	227	176	171	171
query46	1113	844	839	839
query47	1889	1752	1779	1752
query48	365	286	283	283
query49	1077	454	460	454
query50	929	441	433	433
query51	7103	6858	6877	6858
query52	100	94	91	91
query53	260	188	184	184
query54	788	472	451	451
query55	80	74	77	74
query56	289	274	267	267
query57	1223	1074	1072	1072
query58	244	240	243	240
query59	2869	2661	2566	2566
query60	298	279	278	278
query61	144	101	106	101
query62	934	659	676	659
query63	221	190	187	187
query64	4649	690	718	690
query65	3269	3210	3184	3184
query66	1393	310	303	303
query67	15694	15521	15791	15521
query68	3212	877	863	863
query69	430	323	333	323
query70	1187	1129	1111	1111
query71	366	354	346	346
query72	6051	3517	3546	3517
query73	601	588	583	583
query74	9277	9117	9170	9117
query75	3179	3020	3036	3020
query76	1922	868	873	868
query77	452	434	420	420
query78	9937	9312	9291	9291
query79	930	904	895	895
query80	908	965	890	890
query81	448	269	263	263
query82	275	266	268	266
query83	198	189	198	189
query84	228	111	108	108
query85	647	421	408	408
query86	324	321	300	300
query87	4319	4372	4375	4372
query88	4165	4112	4090	4090
query89	380	375	381	375
query90	1274	329	317	317
query91	125	126	123	123
query92	81	79	79	79
query93	1078	1070	1065	1065
query94	598	389	388	388
query95	473	438	437	437
query96	497	469	473	469
query97	3183	3117	3143	3117
query98	236	230	233	230
query99	1599	1322	1324	1322
Total cold run time: 276336 ms
Total hot run time: 195561 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.07	0.03	0.04
query3	0.23	0.05	0.05
query4	1.68	0.07	0.06
query5	0.50	0.50	0.50
query6	1.15	0.73	0.72
query7	0.01	0.01	0.01
query8	0.06	0.04	0.05
query9	0.56	0.52	0.52
query10	0.57	0.58	0.56
query11	0.16	0.11	0.12
query12	0.15	0.12	0.13
query13	0.63	0.61	0.61
query14	1.46	1.49	1.47
query15	0.90	0.88	0.86
query16	0.36	0.37	0.36
query17	1.03	1.01	1.04
query18	0.22	0.21	0.20
query19	1.93	1.80	1.80
query20	0.02	0.01	0.00
query21	15.41	0.71	0.67
query22	3.98	7.72	1.33
query23	17.94	1.33	1.39
query24	2.28	0.23	0.22
query25	0.18	0.08	0.08
query26	0.30	0.19	0.18
query27	0.08	0.08	0.07
query28	13.18	1.13	1.09
query29	12.59	3.30	3.31
query30	0.24	0.06	0.06
query31	2.88	0.42	0.41
query32	3.23	0.50	0.49
query33	3.06	3.08	3.08
query34	15.45	4.32	4.32
query35	4.34	4.36	4.34
query36	0.69	0.48	0.49
query37	0.20	0.17	0.16
query38	0.17	0.16	0.14
query39	0.05	0.04	0.05
query40	0.16	0.14	0.14
query41	0.10	0.05	0.04
query42	0.06	0.05	0.04
query43	0.05	0.05	0.04
Total cold run time: 108.35 s
Total hot run time: 31.11 s

yiguolei
yiguolei previously approved these changes Sep 12, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 12, 2024
Copy link
Contributor

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

Copy link
Contributor

PR approved by anyone and no changes requested.

@yiguolei yiguolei added usercase Important user case type label dev/2.1.x dev/3.0.x labels Sep 13, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

all changes this file are not necessary

@Vallishp Vallishp force-pushed the support_last_query_id branch from 2e74ecf to 0e07775 Compare September 13, 2024 18:44
@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Sep 13, 2024
@Vallishp
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17585	7217	7271	7217
q2	2032	182	181	181
q3	10483	1240	1378	1240
q4	10497	1010	996	996
q5	7732	3154	3126	3126
q6	241	153	151	151
q7	1035	632	616	616
q8	9446	2011	2008	2008
q9	6840	6292	6299	6292
q10	7017	2525	2522	2522
q11	428	245	255	245
q12	409	230	227	227
q13	17768	3025	3005	3005
q14	280	255	248	248
q15	574	531	534	531
q16	510	438	429	429
q17	998	939	957	939
q18	7465	6861	6659	6659
q19	1386	1234	1231	1231
q20	613	341	334	334
q21	3896	3497	3504	3497
q22	1083	972	980	972
Total cold run time: 108318 ms
Total hot run time: 42666 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7147	7144	7153	7144
q2	333	228	244	228
q3	3067	3073	3042	3042
q4	2041	2093	2059	2059
q5	5681	5622	5649	5622
q6	244	152	151	151
q7	2164	1756	1809	1756
q8	3426	3456	3479	3456
q9	8925	9142	8858	8858
q10	3525	3561	3593	3561
q11	592	472	494	472
q12	810	603	624	603
q13	8348	3178	3180	3178
q14	319	290	292	290
q15	579	557	550	550
q16	515	475	466	466
q17	1796	1760	1782	1760
q18	8497	7939	8176	7939
q19	1768	1756	1754	1754
q20	2126	1866	1885	1866
q21	5903	5468	5674	5468
q22	1145	1004	1013	1004
Total cold run time: 68951 ms
Total hot run time: 61227 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 199576 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 0e077758f62192e522af5aa1ed679d478090fd4a, data reload: false

query1	1237	883	887	883
query2	6255	1769	1756	1756
query3	10638	3899	3902	3899
query4	55521	24710	24159	24159
query5	5007	549	540	540
query6	346	174	167	167
query7	5653	296	301	296
query8	291	228	235	228
query9	6112	2585	2567	2567
query10	411	286	271	271
query11	15891	15481	15611	15481
query12	154	105	100	100
query13	1470	417	384	384
query14	9951	7174	6851	6851
query15	205	187	182	182
query16	7019	503	489	489
query17	1125	597	585	585
query18	1880	296	311	296
query19	206	145	153	145
query20	134	112	111	111
query21	211	103	104	103
query22	4668	4663	4495	4495
query23	34551	34062	33780	33780
query24	6058	3068	3076	3068
query25	498	382	391	382
query26	600	155	155	155
query27	1594	273	275	273
query28	2833	2094	2064	2064
query29	659	413	431	413
query30	226	153	153	153
query31	933	761	770	761
query32	74	53	53	53
query33	480	276	286	276
query34	883	486	471	471
query35	846	708	734	708
query36	1007	897	902	897
query37	137	80	79	79
query38	3991	3880	3926	3880
query39	1451	1387	1395	1387
query40	208	110	111	110
query41	47	46	44	44
query42	115	95	95	95
query43	479	428	447	428
query44	1187	787	764	764
query45	197	167	168	167
query46	1088	843	784	784
query47	1870	1799	1810	1799
query48	364	289	298	289
query49	726	437	479	437
query50	927	432	436	432
query51	7010	6851	6901	6851
query52	95	85	85	85
query53	251	178	182	178
query54	555	467	465	465
query55	79	75	75	75
query56	285	254	259	254
query57	1202	1059	1094	1059
query58	234	231	245	231
query59	2777	2667	2762	2667
query60	309	275	281	275
query61	103	100	99	99
query62	817	655	673	655
query63	208	187	182	182
query64	1449	702	721	702
query65	3242	3192	3165	3165
query66	693	303	306	303
query67	15927	15557	15556	15556
query68	2029	870	863	863
query69	427	345	333	333
query70	1137	1157	1147	1147
query71	351	349	347	347
query72	4576	3587	3540	3540
query73	590	580	581	580
query74	9172	9147	8964	8964
query75	3055	2989	3039	2989
query76	922	845	838	838
query77	483	411	408	408
query78	9418	9318	9211	9211
query79	920	896	870	870
query80	839	868	841	841
query81	453	269	263	263
query82	271	261	257	257
query83	198	193	191	191
query84	205	113	110	110
query85	686	567	443	443
query86	320	321	329	321
query87	4241	4281	4450	4281
query88	4142	4105	4077	4077
query89	380	358	361	358
query90	1387	317	314	314
query91	122	120	121	120
query92	78	79	77	77
query93	1029	1021	1022	1021
query94	545	394	378	378
query95	447	426	423	423
query96	471	472	466	466
query97	3110	3083	3098	3083
query98	226	237	220	220
query99	1362	1303	1338	1303
Total cold run time: 287242 ms
Total hot run time: 199576 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.07	0.04	0.04
query3	0.23	0.05	0.05
query4	1.69	0.07	0.06
query5	0.50	0.50	0.49
query6	1.13	0.73	0.72
query7	0.02	0.01	0.02
query8	0.06	0.05	0.04
query9	0.57	0.51	0.52
query10	0.57	0.58	0.55
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.63	0.62	0.61
query14	1.41	1.47	1.47
query15	0.89	0.88	0.88
query16	0.36	0.38	0.37
query17	1.05	1.03	1.03
query18	0.17	0.16	0.16
query19	1.94	1.82	1.74
query20	0.02	0.01	0.01
query21	15.38	0.67	0.65
query22	4.42	6.88	1.46
query23	17.87	1.26	1.25
query24	2.28	0.21	0.21
query25	0.19	0.08	0.07
query26	0.29	0.20	0.18
query27	0.07	0.08	0.07
query28	13.18	1.12	1.10
query29	12.92	3.32	3.32
query30	0.25	0.06	0.05
query31	2.87	0.43	0.41
query32	3.23	0.50	0.50
query33	3.00	3.06	3.11
query34	15.43	4.31	4.32
query35	4.32	4.35	4.34
query36	0.68	0.49	0.49
query37	0.19	0.16	0.17
query38	0.16	0.15	0.14
query39	0.05	0.04	0.04
query40	0.15	0.14	0.14
query41	0.10	0.05	0.05
query42	0.06	0.04	0.04
query43	0.05	0.05	0.04
Total cold run time: 108.8 s
Total hot run time: 31.09 s

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

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

@morrySnow morrySnow merged commit 55727c3 into apache:master Sep 19, 2024
26 of 29 checks passed
yiguolei pushed a commit that referenced this pull request Sep 20, 2024
dataroaring pushed a commit that referenced this pull request Oct 9, 2024
support display previous query id.

mysql> select LAST_QUERY_ID();
No connection. Trying to reconnect...
Connection id:    0
Current database: *** NONE ***

+-----------------+
| last_query_id() |
+-----------------+
| Not Available   |
+-----------------+
1 row in set (0.08 sec)

mysql> select LAST_QUERY_ID();
+-----------------------------------+
| last_query_id()                   |
+-----------------------------------+
| e133f2641e0a411c-b73f1f6c67bedcf9 |
+-----------------------------------+
1 row in set (0.01 sec)
@gavinchou gavinchou mentioned this pull request Nov 26, 2024
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. dev/2.1.7-merged dev/3.0.3-merged reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants