zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

2022-11-16 mysql列存储引擎-支持COUNT中DISTINCT-需求分析

mysql引擎存储 分析 支持 2022 11 16
2023-09-27 14:25:42 时间

摘要:

mysql列存储引擎-支持COUNT中DISTINCT-需求分析

关联ISSUE: https://github.com/stoneatom/stonedb/issues/928

功能需求:

一. 聚合函数COUNT中使用DISTINCT多列可正常查询

参考:

https://dev.mysql.com/doc/refman/5.7/en/aggregate-functions.html#function_count-distinct


CREATE TABLE `t1` (
  idx  int(11), 
  c1   int(11),
  c2   int(11)
) ENGINE=TIANMU;
insert into t1 values   (1, 2, 2), 
                        (1, 2, 3),
                        (1, 2, 4), 
                        (1, 3, 2), 
                        (4, 3, 4);
select count(distinct c1,  c2) from t1;

二. 其他聚合函数中使用distinct

聚合函数参考:

https://dev.mysql.com/doc/refman/5.7/en/aggregate-functions.html

非功能需求:

性能需求:

TODO: