What is cardinality in MySQL?(MySQL 中的基数是什么?)
问题描述
MySQL 中的基数是什么?请用简单的非技术语言解释.
What is cardinality in MySQL? Please explain in simple, non-technical language.
如果任何表的索引详细信息显示一个字段的基数,例如 group_id
为 11,那么这意味着什么?
If a index detail of any table displays the cardinality of a field say group_id
as 11, then what does that mean?
推荐答案
Max cardinality: All values are unique
Max cardinality: All values are unique
最小基数:所有值都相同
Min cardinality: All values are the same
有些列被称为高基数列,因为它们有限制(如唯一),禁止您在每一行中放置相同的值.
Some columns are called high-cardinality columns because they have constraints in place (like unique) prohibiting you from putting the same value in every row.
基数是影响聚类、排序和搜索数据能力的属性.因此,对于数据库中的查询计划者来说,这是一个重要的衡量标准,是他们可以用来选择最佳计划的启发式方法.
Cardinality is a property which affects the ability to cluster, sort and search data. It is therefore an important measurement for the query planners in DBs, it is a heuristic which they can use to choose the best plans.
这篇关于MySQL 中的基数是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:MySQL 中的基数是什么?


基础教程推荐
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01