You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
——row151,调整英文内容为:
<literal>ndistinct</literal>, which enables n-distinct statistics,
——row153至154,调整英文内容为:
dependency statistics, and <literal>mcv</literal> which enables
most-common values lists.
——row163,调整中文内容为:
<literal>ndistinct</literal>,启用功能依赖性统计的<literal>dependencies</literal>,以及启用最常见的值列表的<literal>mcv</literal>。
——row180至181,调整英文内容为:
At least two column names must be given; the order of the column names
is insignificant.
——row185,调整中文内容
被计算的统计信息包含的表格列的名称。至少必须给出两个列名,列名的顺序可以忽略。
——row305至360,增加英文和中文内容为:
<!--==========================orignal english content==========================
<para>
Create table <structname>t2</structname> with two perfectly correlated columns
(containing identical data), and a MCV list on those columns:
<programlisting>
CREATE TABLE t2 (
a int,
b int
);
INSERT INTO t2 SELECT mod(i,100), mod(i,100)
FROM generate_series(1,1000000) s(i);
CREATE STATISTICS s2 (mcv) ON a, b FROM t2;
ANALYZE t2;
-- valid combination (found in MCV)
EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 1);
-- invalid combination (not found in MCV)
EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 2);
</programlisting>
The MCV list gives the planner more detailed information about the
specific values that commonly appear in the table, as well as an upper
bound on the selectivities of combinations of values that do not appear
in the table, allowing it to generate better estimates in both cases.
</para>
____________________________________________________________________________-->
<para>
创建表<structname>t2</structname>与两个完全相关的列(包含相同的数据),并且在这些列上创建一个MCV列表:
<programlisting>
CREATE TABLE t2 (
a int,
b int
);
INSERT INTO t2 SELECT mod(i,100), mod(i,100)
FROM generate_series(1,1000000) s(i);
CREATE STATISTICS s2 (mcv) ON a, b FROM t2;
ANALYZE t2;
-- valid combination (found in MCV)
EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 1);
-- invalid combination (not found in MCV)
EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 2);
</programlisting>
MCV列表为计划器提供了关于表中普遍出现的特定值的更详细的信息,以及表中未显示的值组合的选择性上限,允许它在这两种情况下产生更好的估计值。
</para>
0 commit comments