Skip to content

Commit 5f70a04

Browse files
committed
Make pg_stats example query result a bit less wide, and add comment about
pg_stats.inherited
1 parent 9b8a733 commit 5f70a04

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

doc/src/sgml/perform.sgml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.77 2010/04/28 16:10:40 heikki Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.78 2010/04/28 16:48:21 alvherre Exp $ -->
22

33
<chapter id="performance-tips">
44
<title>Performance Tips</title>
@@ -554,16 +554,31 @@ WHERE relname LIKE 'tenk1%';
554554
For example, we might do:
555555

556556
<screen>
557-
SELECT attname, n_distinct, most_common_vals
557+
SELECT attname, inherited, n_distinct,
558+
array_to_string(most_common_vals, E'\n') as most_common_vals
558559
FROM pg_stats
559560
WHERE tablename = 'road';
560561

561-
attname | n_distinct | most_common_vals
562-
---------+------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
563-
name | -0.467008 | {"I- 580 Ramp","I- 880 Ramp","Sp Railroad ","I- 580 ","I- 680 Ramp","I- 80 Ramp","14th St ","5th St ","Mission Blvd","I- 880 "}
564-
thepath | 20 | {"[(-122.089,37.71),(-122.0886,37.711)]"}
562+
attname | inherited | n_distinct | most_common_vals
563+
---------+-----------+------------+------------------------------------
564+
name | f | -0.363388 | I- 580 Ramp+
565+
| | | I- 880 Ramp+
566+
| | | Sp Railroad +
567+
| | | I- 580 +
568+
| | | I- 680 Ramp
569+
name | t | -0.284859 | I- 880 Ramp+
570+
| | | I- 580 Ramp+
571+
| | | I- 680 Ramp+
572+
| | | I- 580 +
573+
| | | State Hwy 13 Ramp
565574
(2 rows)
566575
</screen>
576+
577+
Note that two rows are displayed for the same column, one corresponding
578+
to the complete inheritance hierarchy starting at the
579+
<literal>road</literal> table (<literal>inherited</>=<literal>t</>),
580+
and another one including only the <literal>road</literal> table itself
581+
(<literal>inherited</>=<literal>f</>).
567582
</para>
568583

569584
<para>

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