Skip to content

Conversation

@csun5285
Copy link
Contributor

@csun5285 csun5285 commented Sep 26, 2024

Proposed changes


select count(b) from table where b = 30 or c = 20;

  • we should read column b
  • Rules for count on index: count is limited to types like count(*) and count(b), and in the query conditions, only count columns are connected using OR.
  • If the query conditions connected by OR include other columns, then it is not a count on index.
  • select count(b) from table where b = 30 or c = 20; is not a count on index, but select count(b) from table where b = 30 or b > 200; is a count on index.

@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.

@csun5285
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17585	7328	7398	7328
q2	2011	295	269	269
q3	12189	1069	1160	1069
q4	10549	759	796	759
q5	7749	2883	2748	2748
q6	237	152	152	152
q7	963	611	598	598
q8	9341	1924	1978	1924
q9	6936	6453	6410	6410
q10	6958	2308	2302	2302
q11	448	253	240	240
q12	412	225	222	222
q13	17775	3025	3007	3007
q14	240	219	207	207
q15	566	537	521	521
q16	655	597	584	584
q17	975	558	573	558
q18	7172	6722	6739	6722
q19	1400	991	985	985
q20	477	197	199	197
q21	3927	3253	3235	3235
q22	1123	1041	1006	1006
Total cold run time: 109688 ms
Total hot run time: 41043 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7299	7224	7183	7183
q2	329	231	228	228
q3	3020	2946	2890	2890
q4	2056	1832	1787	1787
q5	5764	5742	5734	5734
q6	237	145	153	145
q7	2212	1842	1809	1809
q8	3341	3590	3457	3457
q9	8864	8887	8835	8835
q10	3589	3578	3566	3566
q11	578	493	491	491
q12	796	609	655	609
q13	8493	3222	3149	3149
q14	313	286	270	270
q15	572	522	534	522
q16	687	658	659	658
q17	1864	1654	1599	1599
q18	8275	7712	7513	7513
q19	1701	1478	1532	1478
q20	2103	1894	1924	1894
q21	5583	5404	5374	5374
q22	1151	1055	1088	1055
Total cold run time: 68827 ms
Total hot run time: 60246 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 193061 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 091c842d3f87aff678727f79c4bb8a207299f160, data reload: false

query1	940	390	411	390
query2	6271	2179	2124	2124
query3	8697	200	208	200
query4	33605	23545	23448	23448
query5	3552	477	477	477
query6	314	186	196	186
query7	4189	314	311	311
query8	303	227	235	227
query9	9781	2708	2702	2702
query10	473	285	298	285
query11	17895	15163	15345	15163
query12	149	98	97	97
query13	1530	441	426	426
query14	9951	7385	7935	7385
query15	281	184	185	184
query16	8077	510	464	464
query17	1792	620	612	612
query18	2237	328	325	325
query19	369	166	161	161
query20	128	119	127	119
query21	212	114	107	107
query22	4702	4515	4440	4440
query23	35020	34692	34211	34211
query24	11102	2943	2863	2863
query25	611	422	409	409
query26	1089	163	163	163
query27	2175	305	304	304
query28	7167	2446	2427	2427
query29	821	454	444	444
query30	257	159	157	157
query31	1052	828	818	818
query32	105	56	57	56
query33	769	305	326	305
query34	943	505	521	505
query35	859	751	718	718
query36	1120	959	953	953
query37	154	88	89	88
query38	4027	3922	3964	3922
query39	1490	1442	1408	1408
query40	204	100	100	100
query41	51	47	51	47
query42	124	98	104	98
query43	557	498	490	490
query44	1235	795	802	795
query45	200	170	171	170
query46	1173	749	743	743
query47	1925	1816	1864	1816
query48	484	377	377	377
query49	892	432	426	426
query50	833	420	426	420
query51	7095	7040	7004	7004
query52	100	92	91	91
query53	269	185	187	185
query54	1140	480	489	480
query55	80	79	75	75
query56	283	266	263	263
query57	1204	1124	1146	1124
query58	240	237	234	234
query59	3208	2934	2939	2934
query60	314	276	278	276
query61	105	98	106	98
query62	831	682	664	664
query63	223	191	192	191
query64	3928	652	606	606
query65	3295	3223	3205	3205
query66	721	310	302	302
query67	15960	15531	15481	15481
query68	4578	572	574	572
query69	594	305	312	305
query70	1166	1130	1153	1130
query71	406	283	283	283
query72	7533	4090	3976	3976
query73	806	353	347	347
query74	10248	8966	9117	8966
query75	4043	2745	2645	2645
query76	3587	938	924	924
query77	729	309	305	305
query78	10596	9701	9599	9599
query79	4155	608	610	608
query80	1762	461	476	461
query81	584	241	246	241
query82	904	144	146	144
query83	334	138	137	137
query84	304	79	85	79
query85	1962	294	286	286
query86	455	303	312	303
query87	4488	4346	4355	4346
query88	4347	2415	2386	2386
query89	425	306	293	293
query90	2120	195	191	191
query91	179	145	166	145
query92	63	49	48	48
query93	3836	557	550	550
query94	1025	293	292	292
query95	361	256	255	255
query96	659	295	287	287
query97	3272	3168	3178	3168
query98	221	208	205	205
query99	1614	1333	1305	1305
Total cold run time: 308239 ms
Total hot run time: 193061 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.06	0.03	0.03
query3	0.23	0.06	0.06
query4	1.65	0.10	0.10
query5	0.52	0.50	0.51
query6	1.13	0.72	0.72
query7	0.02	0.01	0.01
query8	0.04	0.03	0.02
query9	0.57	0.51	0.50
query10	0.54	0.57	0.55
query11	0.13	0.10	0.10
query12	0.13	0.12	0.11
query13	0.61	0.60	0.60
query14	2.83	2.75	2.72
query15	0.90	0.82	0.82
query16	0.39	0.38	0.39
query17	1.02	0.95	1.09
query18	0.19	0.20	0.20
query19	1.96	1.86	2.03
query20	0.01	0.01	0.01
query21	15.35	0.57	0.59
query22	2.45	1.65	1.91
query23	17.19	0.90	0.86
query24	2.85	0.86	1.23
query25	0.32	0.12	0.07
query26	0.36	0.14	0.13
query27	0.06	0.04	0.04
query28	10.80	1.11	1.08
query29	12.54	3.24	3.22
query30	0.24	0.06	0.05
query31	2.88	0.38	0.37
query32	3.28	0.46	0.45
query33	2.99	2.99	3.06
query34	16.95	4.43	4.43
query35	4.54	4.45	4.56
query36	0.66	0.48	0.49
query37	0.08	0.05	0.06
query38	0.04	0.04	0.04
query39	0.03	0.02	0.02
query40	0.16	0.13	0.12
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 106.89 s
Total hot run time: 32.28 s

Copy link
Member

@airborne12 airborne12 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 28, 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.

@csun5285
Copy link
Contributor Author

csun5285 commented Oct 8, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17942	7540	7317	7317
q2	2011	289	291	289
q3	12127	1049	1165	1049
q4	10479	734	726	726
q5	7730	2895	2802	2802
q6	239	151	152	151
q7	1028	641	612	612
q8	9363	1976	2025	1976
q9	6556	6444	6425	6425
q10	6976	2320	2329	2320
q11	440	254	254	254
q12	417	223	220	220
q13	17811	2986	2993	2986
q14	235	213	201	201
q15	578	521	519	519
q16	658	591	591	591
q17	959	595	638	595
q18	7509	6614	6763	6614
q19	1349	1020	968	968
q20	491	209	207	207
q21	4018	3184	3135	3135
q22	1108	982	960	960
Total cold run time: 110024 ms
Total hot run time: 40917 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7287	7270	7275	7270
q2	329	234	232	232
q3	3098	2974	2982	2974
q4	2093	1859	1842	1842
q5	5739	5772	5783	5772
q6	261	146	147	146
q7	2227	1813	1821	1813
q8	3444	3592	3507	3507
q9	8871	8904	8879	8879
q10	3637	3568	3544	3544
q11	608	486	493	486
q12	869	610	606	606
q13	10357	3153	3183	3153
q14	298	275	275	275
q15	570	532	522	522
q16	676	643	650	643
q17	1836	1611	1594	1594
q18	8355	7848	7601	7601
q19	1726	1624	1381	1381
q20	2139	1847	1865	1847
q21	5606	5429	5384	5384
q22	1225	1029	1004	1004
Total cold run time: 71251 ms
Total hot run time: 60475 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191444 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 77b09a5bb3b3e52cd2cd804e0be1516d3a91310d, data reload: false

query1	878	407	413	407
query2	6275	2048	2000	2000
query3	8683	198	197	197
query4	34197	23394	23402	23394
query5	3452	465	467	465
query6	265	164	160	160
query7	4209	296	297	296
query8	273	209	222	209
query9	9367	2658	2649	2649
query10	464	281	290	281
query11	18023	15231	15197	15197
query12	155	100	94	94
query13	1600	455	433	433
query14	9282	7080	7341	7080
query15	254	170	175	170
query16	7986	492	439	439
query17	1603	620	602	602
query18	2109	328	319	319
query19	260	153	147	147
query20	122	113	116	113
query21	216	110	103	103
query22	4830	4632	4393	4393
query23	35328	34001	34018	34001
query24	11011	2881	2843	2843
query25	643	414	404	404
query26	1134	160	163	160
query27	2635	302	293	293
query28	7719	2425	2406	2406
query29	842	438	436	436
query30	287	149	152	149
query31	1022	814	801	801
query32	97	57	57	57
query33	767	310	289	289
query34	930	507	515	507
query35	851	745	724	724
query36	1098	934	960	934
query37	159	85	85	85
query38	4104	3909	3892	3892
query39	1490	1439	1454	1439
query40	215	98	98	98
query41	46	44	45	44
query42	120	95	93	93
query43	505	487	473	473
query44	1268	792	794	792
query45	198	160	163	160
query46	1147	708	710	708
query47	1938	1816	1820	1816
query48	441	345	353	345
query49	971	410	408	408
query50	825	413	418	413
query51	7123	6903	6874	6874
query52	101	88	89	88
query53	253	178	189	178
query54	1166	476	473	473
query55	79	78	78	78
query56	273	275	284	275
query57	1233	1128	1180	1128
query58	222	218	227	218
query59	3114	2968	2935	2935
query60	284	263	283	263
query61	107	101	106	101
query62	856	658	657	657
query63	222	182	181	181
query64	3948	659	605	605
query65	3254	3192	3146	3146
query66	824	308	303	303
query67	15831	15560	15479	15479
query68	4367	573	563	563
query69	512	291	303	291
query70	1195	1120	1101	1101
query71	340	275	267	267
query72	7292	4026	3940	3940
query73	769	341	338	338
query74	10166	8910	8955	8910
query75	3460	2702	2651	2651
query76	2934	896	918	896
query77	626	288	290	288
query78	10900	9677	9693	9677
query79	1502	591	585	585
query80	1887	441	457	441
query81	595	240	239	239
query82	728	130	137	130
query83	300	142	140	140
query84	282	79	80	79
query85	1551	292	287	287
query86	421	282	302	282
query87	4511	4436	4346	4346
query88	3415	2459	2426	2426
query89	412	293	298	293
query90	2086	188	183	183
query91	165	113	104	104
query92	66	47	46	46
query93	1105	551	546	546
query94	1206	303	289	289
query95	361	259	274	259
query96	617	279	280	279
query97	3326	3207	3155	3155
query98	213	197	200	197
query99	1534	1340	1316	1316
Total cold run time: 300028 ms
Total hot run time: 191444 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.05
query2	0.07	0.02	0.02
query3	0.24	0.06	0.06
query4	1.63	0.11	0.10
query5	0.52	0.52	0.51
query6	1.12	0.73	0.73
query7	0.02	0.01	0.02
query8	0.03	0.03	0.04
query9	0.57	0.50	0.49
query10	0.55	0.54	0.55
query11	0.14	0.11	0.11
query12	0.15	0.11	0.10
query13	0.62	0.59	0.60
query14	2.74	2.74	2.73
query15	0.88	0.82	0.80
query16	0.38	0.41	0.40
query17	1.04	1.04	1.05
query18	0.22	0.22	0.22
query19	1.98	1.84	1.82
query20	0.02	0.01	0.01
query21	15.37	0.59	0.57
query22	2.61	2.53	2.46
query23	16.97	1.16	0.77
query24	3.19	0.96	0.71
query25	0.22	0.06	0.07
query26	0.55	0.14	0.13
query27	0.04	0.04	0.04
query28	10.87	1.08	1.06
query29	12.56	3.18	3.19
query30	0.25	0.06	0.06
query31	2.86	0.39	0.38
query32	3.27	0.46	0.46
query33	3.01	2.97	3.00
query34	17.37	4.49	4.48
query35	4.52	4.60	4.50
query36	0.67	0.48	0.50
query37	0.08	0.06	0.06
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.13	0.12
query41	0.07	0.02	0.03
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 107.76 s
Total hot run time: 32.96 s

@csun5285
Copy link
Contributor Author

csun5285 commented Oct 8, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17614	7364	7242	7242
q2	2026	280	273	273
q3	11992	1079	1184	1079
q4	10562	699	745	699
q5	7753	2907	2832	2832
q6	235	152	153	152
q7	1039	655	610	610
q8	9342	1947	1872	1872
q9	6577	6468	6416	6416
q10	7005	2322	2286	2286
q11	443	246	249	246
q12	419	222	223	222
q13	17776	2970	2982	2970
q14	236	221	212	212
q15	559	525	523	523
q16	652	595	589	589
q17	968	523	584	523
q18	7156	6429	6468	6429
q19	1343	988	914	914
q20	506	210	195	195
q21	4155	3322	3121	3121
q22	1099	981	983	981
Total cold run time: 109457 ms
Total hot run time: 40386 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7280	7270	7225	7225
q2	333	225	225	225
q3	2966	2958	2944	2944
q4	2013	1835	1852	1835
q5	5744	5708	5761	5708
q6	238	147	147	147
q7	2239	1864	1870	1864
q8	3347	3518	3422	3422
q9	8977	8962	8893	8893
q10	3584	3562	3533	3533
q11	580	495	494	494
q12	850	644	658	644
q13	10762	3175	3138	3138
q14	313	284	273	273
q15	587	536	526	526
q16	700	656	652	652
q17	1867	1637	1608	1608
q18	8275	7637	7647	7637
q19	1715	1485	1434	1434
q20	2090	1859	1904	1859
q21	5653	5444	5453	5444
q22	1126	1065	1061	1061
Total cold run time: 71239 ms
Total hot run time: 60566 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191944 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 89a9277146cc3f0166ef29682707fd76489e181a, data reload: false

query1	912	392	395	392
query2	6236	2076	2045	2045
query3	8686	193	197	193
query4	33860	23524	23532	23524
query5	3417	478	462	462
query6	276	159	166	159
query7	4195	308	303	303
query8	302	220	218	218
query9	9502	2705	2680	2680
query10	424	278	284	278
query11	17885	15231	15127	15127
query12	149	97	93	93
query13	1589	453	457	453
query14	9107	7200	7581	7200
query15	245	170	173	170
query16	7990	460	482	460
query17	1626	634	616	616
query18	2130	338	329	329
query19	278	159	164	159
query20	125	117	115	115
query21	209	118	114	114
query22	4725	4472	4535	4472
query23	34879	34024	34116	34024
query24	11135	2860	2870	2860
query25	638	411	408	408
query26	1523	164	170	164
query27	2654	299	310	299
query28	7712	2442	2428	2428
query29	953	445	431	431
query30	256	147	150	147
query31	1027	811	810	810
query32	97	54	57	54
query33	769	310	306	306
query34	911	509	521	509
query35	885	720	739	720
query36	1098	946	950	946
query37	159	90	86	86
query38	4097	3842	3871	3842
query39	1512	1430	1426	1426
query40	261	101	106	101
query41	48	46	44	44
query42	111	102	98	98
query43	552	488	496	488
query44	1258	805	806	805
query45	197	161	161	161
query46	1165	738	731	731
query47	1926	1858	1826	1826
query48	438	354	344	344
query49	1030	415	407	407
query50	833	415	417	415
query51	7152	6850	6993	6850
query52	97	87	89	87
query53	266	185	186	185
query54	1309	481	483	481
query55	78	77	83	77
query56	293	258	272	258
query57	1281	1158	1159	1158
query58	245	282	228	228
query59	3296	2907	2929	2907
query60	321	261	270	261
query61	102	96	104	96
query62	857	670	676	670
query63	233	192	184	184
query64	4907	644	620	620
query65	3246	3209	3404	3209
query66	1379	311	304	304
query67	15783	15482	15561	15482
query68	4705	571	567	567
query69	516	295	307	295
query70	1180	1061	1149	1061
query71	366	273	278	273
query72	7181	4000	3967	3967
query73	758	345	350	345
query74	10212	8966	9033	8966
query75	3422	2727	2676	2676
query76	2995	939	919	919
query77	425	302	297	297
query78	10473	9611	9548	9548
query79	1663	600	602	600
query80	1128	440	445	440
query81	588	240	247	240
query82	737	141	133	133
query83	257	134	136	134
query84	253	79	76	76
query85	1515	299	289	289
query86	417	270	292	270
query87	4461	4268	4324	4268
query88	4093	2451	2443	2443
query89	414	285	292	285
query90	2024	190	183	183
query91	145	106	115	106
query92	60	47	47	47
query93	1281	540	544	540
query94	1126	298	300	298
query95	354	253	254	253
query96	617	280	284	280
query97	3315	3166	3173	3166
query98	221	202	194	194
query99	1495	1286	1323	1286
Total cold run time: 301234 ms
Total hot run time: 191944 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.06	0.03	0.02
query3	0.23	0.06	0.06
query4	1.65	0.10	0.10
query5	0.50	0.50	0.51
query6	1.14	0.75	0.71
query7	0.02	0.02	0.01
query8	0.04	0.03	0.04
query9	0.57	0.50	0.50
query10	0.56	0.56	0.55
query11	0.13	0.11	0.11
query12	0.13	0.11	0.11
query13	0.61	0.58	0.60
query14	2.86	2.75	2.72
query15	0.92	0.83	0.84
query16	0.39	0.37	0.39
query17	1.06	1.04	1.09
query18	0.20	0.20	0.20
query19	1.88	1.87	1.95
query20	0.01	0.00	0.01
query21	15.36	0.59	0.57
query22	2.54	2.49	1.58
query23	16.96	1.06	0.85
query24	2.67	1.46	1.63
query25	0.18	0.04	0.17
query26	0.51	0.14	0.14
query27	0.04	0.03	0.03
query28	9.93	1.08	1.08
query29	12.59	3.22	3.24
query30	0.25	0.08	0.06
query31	2.86	0.39	0.39
query32	3.25	0.47	0.46
query33	3.00	3.00	3.05
query34	16.99	4.43	4.49
query35	4.49	4.49	4.54
query36	0.66	0.49	0.49
query37	0.08	0.06	0.05
query38	0.05	0.03	0.04
query39	0.03	0.02	0.02
query40	0.16	0.13	0.12
query41	0.06	0.02	0.02
query42	0.04	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.74 s
Total hot run time: 32.93 s

Copy link
Member

@airborne12 airborne12 left a comment

Choose a reason for hiding this comment

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

LGTM

@airborne12 airborne12 merged commit e08811b into apache:master Oct 9, 2024
eldenmoon pushed a commit to eldenmoon/incubator-doris that referenced this pull request Oct 10, 2024
…ount on index (apache#41375)

## Proposed changes

```

select count(b) from table where b = 30 or c = 20;

```

- we should read column b
- Rules for count on index: count is limited to types like count(*) and
count(b), and in the query conditions, only count columns are connected
using OR.
- If the query conditions connected by OR include other columns, then it
is not a count on index.
- `select count(b) from table where b = 30 or c = 20;` is not a count on
index, but `select count(b) from table where b = 30 or b > 200; ` is a
count on index.
yiguolei pushed a commit that referenced this pull request Oct 11, 2024
…ount on index (#41375) (#41690)

## Proposed changes

pick from master  #41375

<!--Describe your changes.-->
cjj2010 pushed a commit to cjj2010/doris that referenced this pull request Oct 12, 2024
…ount on index (apache#41375)

## Proposed changes

```

select count(b) from table where b = 30 or c = 20;

```

- we should read column b
- Rules for count on index: count is limited to types like count(*) and
count(b), and in the query conditions, only count columns are connected
using OR.
- If the query conditions connected by OR include other columns, then it
is not a count on index.
- `select count(b) from table where b = 30 or c = 20;` is not a count on
index, but `select count(b) from table where b = 30 or b > 200; ` is a
count on index.
amorynan pushed a commit to amorynan/doris that referenced this pull request Oct 12, 2024
…ount on index (apache#41375)

## Proposed changes

```

select count(b) from table where b = 30 or c = 20;

```

- we should read column b
- Rules for count on index: count is limited to types like count(*) and
count(b), and in the query conditions, only count columns are connected
using OR.
- If the query conditions connected by OR include other columns, then it
is not a count on index.
- `select count(b) from table where b = 30 or c = 20;` is not a count on
index, but `select count(b) from table where b = 30 or b > 200; ` is a
count on index.
@xiaokang xiaokang added the p0_w label Oct 15, 2024
xiaokang pushed a commit that referenced this pull request Oct 15, 2024
airborne12 pushed a commit that referenced this pull request Oct 22, 2024
airborne12 pushed a commit that referenced this pull request Oct 24, 2024
csun5285 added a commit to csun5285/doris that referenced this pull request Oct 24, 2024
csun5285 added a commit to csun5285/doris that referenced this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants