MySQL中的基数是什么? [英] What is cardinality in MySQL?

查看:223
本文介绍了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

最小基数:所有值都相同

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中的基数是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆