Skip to content

Commit 7e0fb16

Browse files
committed
docs: adjust multi-column most-common-value statistics
This commit adds a mention that the order of columns specified during multi-column most-common-value statistics is insignificant, and tries to simplify examples. Discussion: https://postgr.es/m/20190828162238.GA8360@momjian.us Backpatch-through: 12
1 parent 7524c78 commit 7e0fb16

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/src/sgml/perform.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ WHERE tablename = 'road';
11721172
<para>
11731173
Here is an example of collecting functional-dependency statistics:
11741174
<programlisting>
1175-
CREATE STATISTICS stts (dependencies) ON zip, city FROM zipcodes;
1175+
CREATE STATISTICS stts (dependencies) ON city, zip FROM zipcodes;
11761176

11771177
ANALYZE zipcodes;
11781178

@@ -1262,7 +1262,7 @@ SELECT * FROM zipcodes WHERE city = 'San Francisco' AND zip = '90210';
12621262
Continuing the previous example, the n-distinct counts in a
12631263
table of ZIP codes might look like the following:
12641264
<programlisting>
1265-
CREATE STATISTICS stts2 (ndistinct) ON zip, state, city FROM zipcodes;
1265+
CREATE STATISTICS stts2 (ndistinct) ON city, state, zip FROM zipcodes;
12661266

12671267
ANALYZE zipcodes;
12681268

@@ -1317,7 +1317,7 @@ nd | {"1, 2": 33178, "1, 5": 33178, "2, 5": 27435, "1, 2, 5": 33178}
13171317
a function is required for inspection of MCV contents):
13181318

13191319
<programlisting>
1320-
CREATE STATISTICS stts3 (mcv) ON state, city FROM zipcodes;
1320+
CREATE STATISTICS stts3 (mcv) ON city, state FROM zipcodes;
13211321

13221322
ANALYZE zipcodes;
13231323

doc/src/sgml/ref/create_statistics.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ CREATE STATISTICS [ IF NOT EXISTS ] <replaceable class="parameter">statistics_na
9898
<listitem>
9999
<para>
100100
The name of a table column to be covered by the computed statistics.
101-
At least two column names must be given.
101+
At least two column names must be given; the order of the column names
102+
is insignificant.
102103
</para>
103104
</listitem>
104105
</varlistentry>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy