Introduction to Optimizer Statistics

简介:
The optimizer cost model relies on statistics collected about the objects involved in a query, and the database and host where the query runs.

Statistics are critical to the optimizer's ability to pick the best execution plan for a SQL statement.

Optimizer statistics include the following:

Table statistics

Number of rows
Number of blocks
Average row length

Column statistics

Number of distinct values (NDV) in a column
Number of nulls in a column
Data distribution (histogram)
Extended statistics

Index statistics

Number of leaf blocks
Number of levels
Index clustering factor
System statistics

I/O performance and utilization
CPU performance and utilization
As shown in Figure 10-1, the database stores optimizer statistics for tables, columns, indexes, and the system in the data dictionary. You can access these statistics using data dictionary views.
AI 代码解读

Introduction to Optimizer Statistics










本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/2071989,如需转载请自行联系原作者
目录
打赏
0
0
0
0
235
分享
相关文章
Optimization and Indexes
MySQL通过索引快速定位具有特定列值的行,避免全表扫描,提高查询效率。常用的索引如PRIMARY KEY、UNIQUE等大多存储在B树中,特殊情况使用R树或哈希索引。索引帮助快速匹配WHERE子句条件的行,减少候选行数,并在多列索引和表连接操作中优化查询。具体特性如B树和哈希索引的比较见特定章节。
WHERE Clause Optimization
本节探讨了WHERE子句的优化方法,虽然示例基于SELECT语句,但也适用于DELETE和UPDATE语句。MySQL自动执行多种优化,例如仅计算一次索引使用的常量表达式、快速检测无效表达式、合并HAVING和WHERE子句、优先读取常量表、寻找最佳连接组合、使用内存中的临时表、选择最佳索引以及在某些情况下仅使用索引树解析查询,从而提升查询效率。
Performance Optimization
Performance Optimization
2945 2
ACL2022:A Simple yet Effective Relation Information Guided Approach for Few-Shot Relation Extraction
少样本关系提取旨在通过在每个关系中使用几个标记的例子进行训练来预测句子中一对实体的关系。最近的一些工作引入了关系信息
167 0
Adaptive Query Optimization
Adaptive Query Optimization
70 4
|
11月前
|
SQL
Adaptive Statistics
Adaptive Statistics
45 0
Volcano - An Extensible and Parallel Query Evaluation System 论文解读
前面写了一些关于优化器的文章,现在开个小差,写一些执行器的paper介绍,从这篇开始。 这篇是Graefe的Volcano Project的执行器框架,其概念已被广泛接受和使用,也就是我们最为熟悉的Volcano iterator的执行框架,关于volcano/cascades的优化器介绍
797 0
Adaptive Execution of Compiled Queries 论文解读
本篇是TUM的内存数据库HyPer针对compile-based执行框架的改进。其中涉及到HyPer的动态编译和并行执行框架 动态编译文章的结尾提到了编译执行系统存在的2个问题,其中之一就是:不可控的编译时间。
534 0
Adaptive Execution of Compiled Queries 论文解读
The MemSQL Query Optimizer: A modern optimizer for real-time analytics in a distributed database
今天我们要介绍的MemSQL就采用这样一种新的形态(Oracle也变为了这种方式 ):即在做transformation时,要基于cost确定其是否可应用。 当然,本篇paper不止讲解了CBQT,还包括一些MemSQL优化器其他方面的介绍,包括一个有意思的heurstic based bushy join的方案。
435 0
The MemSQL Query Optimizer: A modern optimizer for real-time analytics in a distributed database
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等