4 * No.16-1 export_plain_stats-9.3.sql.sample
8 DELETE FROM dbms_stats._column_stats_locked;
9 DELETE FROM dbms_stats._relation_stats_locked;
10 SELECT dbms_stats.lock_database_stats();
32 UPDATE dbms_stats._relation_stats_locked
33 SET (relpages, reltuples, relallvisible, curpages) = (0,0,0,0);
34 UPDATE dbms_stats._column_stats_locked SET
35 stanullfrac = -staattnum,
36 stawidth = -staattnum,
37 stadistinct = -staattnum,
48 stanumbers1 = ARRAY[-staattnum,22],
49 stanumbers2 = ARRAY[-staattnum,23],
50 stanumbers3 = ARRAY[-staattnum,24],
51 stanumbers4 = ARRAY[-staattnum,21],
52 stanumbers5 = ARRAY[-staattnum,25],
53 stavalues1 = stavalues3,
54 stavalues2 = stavalues2,
55 stavalues3 = stavalues1,
56 stavalues4 = stavalues4,
57 stavalues5 = stavalues5;
58 \i doc/export_plain_stats-9.3.sql.sample
60 * If you want the statistics of per-relation or per-column, please modify
61 * nspname, relname, and attname in 'WHERE' clause.
63 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
65 * If you want to chage the output file name, please modify the following name.
68 COPY (SELECT n2.nspname,
73 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
75 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
77 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
79 COALESCE(a.attname, ''),
80 n1.nspname AS schemaname_of_atttype,
109 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
111 ON a.atttypid = t.oid
113 ON t.typnamespace = n1.oid
114 RIGHT JOIN pg_catalog.pg_class c
115 ON s.starelid = c.oid
116 JOIN pg_catalog.pg_namespace n2
117 ON c.relnamespace = n2.oid
118 WHERE c.relkind IN ('r', 'i', 'f', 'm')
119 AND NOT n2.nspname IN ('pg_catalog',
121 'information_schema',
123 -- AND n2.nspname = 'public'
124 -- AND c.relname = 'test'
125 -- AND a.attname = 'id'
126 ORDER BY starelid, staattnum)
131 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
132 SELECT * FROM work_v;
133 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
134 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+------------------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
135 public | pt0 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
136 public | pt0_idx | 2 | 0 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
137 public | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
138 public | st0 | 1 | 2 | 1 | 1 | name | pg_catalog | bpchar | 9 | f | 0 | 6 | -0.5 | 1 | 3 | 0 | 0 | 0 | 1054 | 1058 | 0 | 0 | 0 | {1} | {1} | (null) | (null) | (null) | {"test "} | (null) | (null) | (null) | (null)
139 public | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
140 public | st1 | 45 | 10000 | 45 | 45 | str | pg_catalog | text | -1 | f | 0 | 2 | 3 | 1 | 3 | 0 | 0 | 0 | 98 | 664 | 0 | 0 | 0 | {0.3334,0.3333,0.3333} | {0.3332} | (null) | (null) | (null) | {1,0,2} | (null) | (null) | (null) | (null)
141 public | st1 | 45 | 10000 | 45 | 45 | val | pg_catalog | int4 | -1 | f | 0 | 4 | 3 | 1 | 3 | 0 | 0 | 0 | 96 | 97 | 0 | 0 | 0 | {0.3334,0.3333,0.3333} | {0.3332} | (null) | (null) | (null) | {1,0,2} | (null) | (null) | (null) | (null)
142 public | st1_exp | 30 | 10000 | 0 | 30 | lower | pg_catalog | text | -1 | f | 0 | 5 | 3 | 1 | 3 | 0 | 0 | 0 | 98 | 664 | 0 | 0 | 0 | {0.3334,0.3333,0.3333} | {0.3332} | (null) | (null) | (null) | {1,0,2} | (null) | (null) | (null) | (null)
143 public | st1_idx | 30 | 10000 | 0 | 30 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
144 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null) | (null) | (null)
145 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
146 s0 | smv0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
147 s0 | smv0 | 1 | 2 | 1 | 1 | txt | pg_catalog | text | -1 | f | 0 | 3 | -1 | 2 | 3 | 0 | 0 | 0 | 664 | 664 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,test} | (null) | (null) | (null) | (null)
148 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
149 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
150 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
151 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20,40,50,60} | (null) | (null) | (null) | (null)
152 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
153 s0 | st1 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {4,5,6} | (null) | (null) | (null) | (null)
154 s0 | st1 | 1 | 3 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {40,50,60} | (null) | (null) | (null) | (null)
155 s0 | st1_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
156 s0 | st2 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3} | (null) | (null) | (null) | (null)
157 s0 | st2 | 1 | 3 | 1 | 1 | txt | pg_catalog | text | -1 | f | 0 | 5 | -1 | 2 | 3 | 0 | 0 | 0 | 664 | 664 | 0 | 0 | 0 | (null) | {0.5} | (null) | (null) | (null) | {1,comment,test} | (null) | (null) | (null) | (null)
158 s0 | st2_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
159 s0 | st3 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
160 s1 | st0 | 1 | 4 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3,4} | (null) | (null) | (null) | (null)
161 s1 | st0 | 1 | 4 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {15,25,35,45} | (null) | (null) | (null) | (null)
164 TRUNCATE dbms_stats.work;
166 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s0\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
167 \i doc/export_plain_stats-9.3.sql.sample_test
169 * If you want the statistics of per-relation or per-column, please modify
170 * nspname, relname, and attname in 'WHERE' clause.
172 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
174 * If you want to chage the output file name, please modify the following name.
177 COPY (SELECT n2.nspname,
182 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
184 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
186 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
188 COALESCE(a.attname, ''),
189 n1.nspname AS schemaname_of_atttype,
218 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
220 ON a.atttypid = t.oid
222 ON t.typnamespace = n1.oid
223 RIGHT JOIN pg_catalog.pg_class c
224 ON s.starelid = c.oid
225 JOIN pg_catalog.pg_namespace n2
226 ON c.relnamespace = n2.oid
227 WHERE c.relkind IN ('r', 'i', 'f', 'm')
228 AND NOT n2.nspname IN ('pg_catalog',
230 'information_schema',
232 -- AND n2.nspname = 'public'
233 -- AND c.relname = 'test'
234 -- AND a.attname = 'id'
235 AND n2.nspname = 's0'
236 ORDER BY starelid, staattnum)
241 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
242 SELECT * FROM work_v;
243 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
244 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
245 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null) | (null) | (null)
246 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
247 s0 | smv0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
248 s0 | smv0 | 1 | 2 | 1 | 1 | txt | pg_catalog | text | -1 | f | 0 | 3 | -1 | 2 | 3 | 0 | 0 | 0 | 664 | 664 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,test} | (null) | (null) | (null) | (null)
249 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
250 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
251 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
252 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20,40,50,60} | (null) | (null) | (null) | (null)
253 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
254 s0 | st1 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {4,5,6} | (null) | (null) | (null) | (null)
255 s0 | st1 | 1 | 3 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {40,50,60} | (null) | (null) | (null) | (null)
256 s0 | st1_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
257 s0 | st2 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3} | (null) | (null) | (null) | (null)
258 s0 | st2 | 1 | 3 | 1 | 1 | txt | pg_catalog | text | -1 | f | 0 | 5 | -1 | 2 | 3 | 0 | 0 | 0 | 664 | 664 | 0 | 0 | 0 | (null) | {0.5} | (null) | (null) | (null) | {1,comment,test} | (null) | (null) | (null) | (null)
259 s0 | st2_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
260 s0 | st3 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
263 TRUNCATE dbms_stats.work;
264 \! rm doc/export_plain_stats-9.3.sql.sample_test
266 \! sed '/ORDER/i\\ AND c.relname = '"\'st0\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
267 \i doc/export_plain_stats-9.3.sql.sample_test
269 * If you want the statistics of per-relation or per-column, please modify
270 * nspname, relname, and attname in 'WHERE' clause.
272 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
274 * If you want to chage the output file name, please modify the following name.
277 COPY (SELECT n2.nspname,
282 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
284 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
286 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
288 COALESCE(a.attname, ''),
289 n1.nspname AS schemaname_of_atttype,
318 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
320 ON a.atttypid = t.oid
322 ON t.typnamespace = n1.oid
323 RIGHT JOIN pg_catalog.pg_class c
324 ON s.starelid = c.oid
325 JOIN pg_catalog.pg_namespace n2
326 ON c.relnamespace = n2.oid
327 WHERE c.relkind IN ('r', 'i', 'f', 'm')
328 AND NOT n2.nspname IN ('pg_catalog',
330 'information_schema',
332 -- AND n2.nspname = 'public'
333 -- AND c.relname = 'test'
334 -- AND a.attname = 'id'
335 AND c.relname = 'st0'
336 ORDER BY starelid, staattnum)
341 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
342 SELECT * FROM work_v;
343 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
344 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+------------+------------+------------
345 public | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
346 public | st0 | 1 | 2 | 1 | 1 | name | pg_catalog | bpchar | 9 | f | 0 | 6 | -0.5 | 1 | 3 | 0 | 0 | 0 | 1054 | 1058 | 0 | 0 | 0 | {1} | {1} | (null) | (null) | (null) | {"test "} | (null) | (null) | (null) | (null)
347 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
348 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
349 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
350 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20,40,50,60} | (null) | (null) | (null) | (null)
351 s1 | st0 | 1 | 4 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3,4} | (null) | (null) | (null) | (null)
352 s1 | st0 | 1 | 4 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {15,25,35,45} | (null) | (null) | (null) | (null)
355 TRUNCATE dbms_stats.work;
356 \! rm doc/export_plain_stats-9.3.sql.sample_test
358 \! sed '/ORDER/i\\ AND c.relname = '"\'pg_toast_1262\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
359 \i doc/export_plain_stats-9.3.sql.sample_test
361 * If you want the statistics of per-relation or per-column, please modify
362 * nspname, relname, and attname in 'WHERE' clause.
364 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
366 * If you want to chage the output file name, please modify the following name.
369 COPY (SELECT n2.nspname,
374 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
376 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
378 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
380 COALESCE(a.attname, ''),
381 n1.nspname AS schemaname_of_atttype,
410 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
412 ON a.atttypid = t.oid
414 ON t.typnamespace = n1.oid
415 RIGHT JOIN pg_catalog.pg_class c
416 ON s.starelid = c.oid
417 JOIN pg_catalog.pg_namespace n2
418 ON c.relnamespace = n2.oid
419 WHERE c.relkind IN ('r', 'i', 'f', 'm')
420 AND NOT n2.nspname IN ('pg_catalog',
422 'information_schema',
424 -- AND n2.nspname = 'public'
425 -- AND c.relname = 'test'
426 -- AND a.attname = 'id'
427 AND c.relname = 'pg_toast_1262'
428 ORDER BY starelid, staattnum)
433 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
434 SELECT * FROM work_v;
435 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
436 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
439 TRUNCATE dbms_stats.work;
440 \! rm doc/export_plain_stats-9.3.sql.sample_test
442 \! sed '/ORDER/i\\ AND c.relname = '"\'st0_idx\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
443 \i doc/export_plain_stats-9.3.sql.sample_test
445 * If you want the statistics of per-relation or per-column, please modify
446 * nspname, relname, and attname in 'WHERE' clause.
448 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
450 * If you want to chage the output file name, please modify the following name.
453 COPY (SELECT n2.nspname,
458 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
460 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
462 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
464 COALESCE(a.attname, ''),
465 n1.nspname AS schemaname_of_atttype,
494 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
496 ON a.atttypid = t.oid
498 ON t.typnamespace = n1.oid
499 RIGHT JOIN pg_catalog.pg_class c
500 ON s.starelid = c.oid
501 JOIN pg_catalog.pg_namespace n2
502 ON c.relnamespace = n2.oid
503 WHERE c.relkind IN ('r', 'i', 'f', 'm')
504 AND NOT n2.nspname IN ('pg_catalog',
506 'information_schema',
508 -- AND n2.nspname = 'public'
509 -- AND c.relname = 'test'
510 -- AND a.attname = 'id'
511 AND c.relname = 'st0_idx'
512 ORDER BY starelid, staattnum)
517 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
518 SELECT * FROM work_v;
519 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
520 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
521 public | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
522 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
525 TRUNCATE dbms_stats.work;
526 \! rm doc/export_plain_stats-9.3.sql.sample_test
528 \! sed '/ORDER/i\\ AND c.relname = '"\'ss0\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
529 \i doc/export_plain_stats-9.3.sql.sample_test
531 * If you want the statistics of per-relation or per-column, please modify
532 * nspname, relname, and attname in 'WHERE' clause.
534 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
536 * If you want to chage the output file name, please modify the following name.
539 COPY (SELECT n2.nspname,
544 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
546 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
548 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
550 COALESCE(a.attname, ''),
551 n1.nspname AS schemaname_of_atttype,
580 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
582 ON a.atttypid = t.oid
584 ON t.typnamespace = n1.oid
585 RIGHT JOIN pg_catalog.pg_class c
586 ON s.starelid = c.oid
587 JOIN pg_catalog.pg_namespace n2
588 ON c.relnamespace = n2.oid
589 WHERE c.relkind IN ('r', 'i', 'f', 'm')
590 AND NOT n2.nspname IN ('pg_catalog',
592 'information_schema',
594 -- AND n2.nspname = 'public'
595 -- AND c.relname = 'test'
596 -- AND a.attname = 'id'
597 AND c.relname = 'ss0'
598 ORDER BY starelid, staattnum)
603 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
604 SELECT * FROM work_v;
605 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
606 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
609 TRUNCATE dbms_stats.work;
610 \! rm doc/export_plain_stats-9.3.sql.sample_test
612 \! sed '/ORDER/i\\ AND c.relname = '"\'sc0\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
613 \i doc/export_plain_stats-9.3.sql.sample_test
615 * If you want the statistics of per-relation or per-column, please modify
616 * nspname, relname, and attname in 'WHERE' clause.
618 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
620 * If you want to chage the output file name, please modify the following name.
623 COPY (SELECT n2.nspname,
628 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
630 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
632 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
634 COALESCE(a.attname, ''),
635 n1.nspname AS schemaname_of_atttype,
664 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
666 ON a.atttypid = t.oid
668 ON t.typnamespace = n1.oid
669 RIGHT JOIN pg_catalog.pg_class c
670 ON s.starelid = c.oid
671 JOIN pg_catalog.pg_namespace n2
672 ON c.relnamespace = n2.oid
673 WHERE c.relkind IN ('r', 'i', 'f', 'm')
674 AND NOT n2.nspname IN ('pg_catalog',
676 'information_schema',
678 -- AND n2.nspname = 'public'
679 -- AND c.relname = 'test'
680 -- AND a.attname = 'id'
681 AND c.relname = 'sc0'
682 ORDER BY starelid, staattnum)
687 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
688 SELECT * FROM work_v;
689 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
690 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
693 TRUNCATE dbms_stats.work;
694 \! rm doc/export_plain_stats-9.3.sql.sample_test
696 \! sed '/ORDER/i\\ AND c.relname = '"\'sft0\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
697 \i doc/export_plain_stats-9.3.sql.sample_test
699 * If you want the statistics of per-relation or per-column, please modify
700 * nspname, relname, and attname in 'WHERE' clause.
702 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
704 * If you want to chage the output file name, please modify the following name.
707 COPY (SELECT n2.nspname,
712 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
714 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
716 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
718 COALESCE(a.attname, ''),
719 n1.nspname AS schemaname_of_atttype,
748 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
750 ON a.atttypid = t.oid
752 ON t.typnamespace = n1.oid
753 RIGHT JOIN pg_catalog.pg_class c
754 ON s.starelid = c.oid
755 JOIN pg_catalog.pg_namespace n2
756 ON c.relnamespace = n2.oid
757 WHERE c.relkind IN ('r', 'i', 'f', 'm')
758 AND NOT n2.nspname IN ('pg_catalog',
760 'information_schema',
762 -- AND n2.nspname = 'public'
763 -- AND c.relname = 'test'
764 -- AND a.attname = 'id'
765 AND c.relname = 'sft0'
766 ORDER BY starelid, staattnum)
771 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
772 SELECT * FROM work_v;
773 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
774 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
775 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null) | (null) | (null)
778 TRUNCATE dbms_stats.work;
779 \! rm doc/export_plain_stats-9.3.sql.sample_test
781 \! sed '/ORDER/i\\ AND c.relname = '"\'smv0\'" doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
782 \i doc/export_plain_stats-9.3.sql.sample_test
784 * If you want the statistics of per-relation or per-column, please modify
785 * nspname, relname, and attname in 'WHERE' clause.
787 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
789 * If you want to chage the output file name, please modify the following name.
792 COPY (SELECT n2.nspname,
797 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
799 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
801 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
803 COALESCE(a.attname, ''),
804 n1.nspname AS schemaname_of_atttype,
833 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
835 ON a.atttypid = t.oid
837 ON t.typnamespace = n1.oid
838 RIGHT JOIN pg_catalog.pg_class c
839 ON s.starelid = c.oid
840 JOIN pg_catalog.pg_namespace n2
841 ON c.relnamespace = n2.oid
842 WHERE c.relkind IN ('r', 'i', 'f', 'm')
843 AND NOT n2.nspname IN ('pg_catalog',
845 'information_schema',
847 -- AND n2.nspname = 'public'
848 -- AND c.relname = 'test'
849 -- AND a.attname = 'id'
850 AND c.relname = 'smv0'
851 ORDER BY starelid, staattnum)
856 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
857 SELECT * FROM work_v;
858 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
859 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
860 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
861 s0 | smv0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
862 s0 | smv0 | 1 | 2 | 1 | 1 | txt | pg_catalog | text | -1 | f | 0 | 3 | -1 | 2 | 3 | 0 | 0 | 0 | 664 | 664 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,test} | (null) | (null) | (null) | (null)
865 TRUNCATE dbms_stats.work;
866 \! rm doc/export_plain_stats-9.3.sql.sample_test
868 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s0\'"' AND a.attname = '\'id\' doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
869 \i doc/export_plain_stats-9.3.sql.sample_test
871 * If you want the statistics of per-relation or per-column, please modify
872 * nspname, relname, and attname in 'WHERE' clause.
874 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
876 * If you want to chage the output file name, please modify the following name.
879 COPY (SELECT n2.nspname,
884 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
886 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
888 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
890 COALESCE(a.attname, ''),
891 n1.nspname AS schemaname_of_atttype,
920 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
922 ON a.atttypid = t.oid
924 ON t.typnamespace = n1.oid
925 RIGHT JOIN pg_catalog.pg_class c
926 ON s.starelid = c.oid
927 JOIN pg_catalog.pg_namespace n2
928 ON c.relnamespace = n2.oid
929 WHERE c.relkind IN ('r', 'i', 'f', 'm')
930 AND NOT n2.nspname IN ('pg_catalog',
932 'information_schema',
934 -- AND n2.nspname = 'public'
935 -- AND c.relname = 'test'
936 -- AND a.attname = 'id'
937 AND n2.nspname = 's0' AND a.attname = 'id'
938 ORDER BY starelid, staattnum)
943 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
944 SELECT * FROM work_v;
945 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
946 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
947 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null) | (null) | (null)
948 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
949 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
950 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
951 s0 | st1 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {4,5,6} | (null) | (null) | (null) | (null)
952 s0 | st2 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,3} | (null) | (null) | (null) | (null)
955 TRUNCATE dbms_stats.work;
956 \! rm doc/export_plain_stats-9.3.sql.sample_test
958 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s0\'"' AND a.attname IS NULL' doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
959 \i doc/export_plain_stats-9.3.sql.sample_test
961 * If you want the statistics of per-relation or per-column, please modify
962 * nspname, relname, and attname in 'WHERE' clause.
964 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
966 * If you want to chage the output file name, please modify the following name.
969 COPY (SELECT n2.nspname,
974 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
976 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
978 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
980 COALESCE(a.attname, ''),
981 n1.nspname AS schemaname_of_atttype,
1010 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
1012 ON a.atttypid = t.oid
1013 JOIN pg_namespace n1
1014 ON t.typnamespace = n1.oid
1015 RIGHT JOIN pg_catalog.pg_class c
1016 ON s.starelid = c.oid
1017 JOIN pg_catalog.pg_namespace n2
1018 ON c.relnamespace = n2.oid
1019 WHERE c.relkind IN ('r', 'i', 'f', 'm')
1020 AND NOT n2.nspname IN ('pg_catalog',
1022 'information_schema',
1024 -- AND n2.nspname = 'public'
1025 -- AND c.relname = 'test'
1026 -- AND a.attname = 'id'
1027 AND n2.nspname = 's0' AND a.attname IS NULL
1028 ORDER BY starelid, staattnum)
1033 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1034 SELECT * FROM work_v;
1035 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1036 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1037 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1038 s0 | st1_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1039 s0 | st2_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1040 s0 | st3 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1043 TRUNCATE dbms_stats.work;
1044 \! rm doc/export_plain_stats-9.3.sql.sample_test
1046 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s1\'"' AND c.relname IS NULL' doc/export_plain_stats-9.3.sql.sample > doc/export_plain_stats-9.3.sql.sample_test
1047 \i doc/export_plain_stats-9.3.sql.sample_test
1049 * If you want the statistics of per-relation or per-column, please modify
1050 * nspname, relname, and attname in 'WHERE' clause.
1052 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1054 * If you want to chage the output file name, please modify the following name.
1057 COPY (SELECT n2.nspname,
1062 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
1064 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
1066 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
1067 AS last_autoanalyze,
1068 COALESCE(a.attname, ''),
1069 n1.nspname AS schemaname_of_atttype,
1098 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
1100 ON a.atttypid = t.oid
1101 JOIN pg_namespace n1
1102 ON t.typnamespace = n1.oid
1103 RIGHT JOIN pg_catalog.pg_class c
1104 ON s.starelid = c.oid
1105 JOIN pg_catalog.pg_namespace n2
1106 ON c.relnamespace = n2.oid
1107 WHERE c.relkind IN ('r', 'i', 'f', 'm')
1108 AND NOT n2.nspname IN ('pg_catalog',
1110 'information_schema',
1112 -- AND n2.nspname = 'public'
1113 -- AND c.relname = 'test'
1114 -- AND a.attname = 'id'
1115 AND n2.nspname = 's1' AND c.relname IS NULL
1116 ORDER BY starelid, staattnum)
1121 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1122 SELECT * FROM work_v;
1123 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1124 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1127 TRUNCATE dbms_stats.work;
1128 \! rm doc/export_plain_stats-9.3.sql.sample_test
1130 * No.16-2 export_effective_stats-9.3.sql.sample
1134 SELECT dbms_stats.lock_database_stats();
1136 ---------------------
1156 UPDATE dbms_stats._relation_stats_locked
1157 SET (relpages, reltuples, relallvisible, curpages) = (NULL, NULL, NULL, NULL);
1158 UPDATE dbms_stats._column_stats_locked
1159 SET (stanullfrac, stawidth, stadistinct,
1160 stakind1, stakind2, stakind3, stakind4, stakind5,
1161 staop1, staop2, staop3, staop4, staop5,
1162 stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5,
1163 stavalues1, stavalues2, stavalues3, stavalues4, stavalues5)
1164 = (NULL, NULL, NULL,
1165 NULL, NULL, NULL, NULL, NULL,
1166 NULL, NULL, NULL, NULL, NULL,
1167 NULL, NULL, NULL, NULL, NULL,
1168 NULL, NULL, NULL, NULL, NULL)
1169 WHERE starelid = 's0.st0'::regclass;
1170 \i doc/export_effective_stats-9.3.sql.sample
1172 * If you want the statistics of per-relation or per-column, please modify
1173 * nspname, relname, and attname in 'WHERE' clause.
1175 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1177 * If you want to chage the output file name, please modify the following name.
1180 COPY (SELECT n2.nspname,
1188 COALESCE(a.attname, ''),
1189 n1.nspname AS schemaname_of_atttype,
1216 FROM dbms_stats.column_stats_effective co
1218 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1220 ON a.atttypid = t.oid
1221 JOIN pg_namespace n1
1222 ON t.typnamespace = n1.oid
1223 RIGHT JOIN dbms_stats.relation_stats_effective r
1224 ON co.starelid = r.relid
1225 JOIN pg_catalog.pg_class cl
1227 JOIN pg_catalog.pg_namespace n2
1228 ON cl.relnamespace = n2.oid
1229 -- WHERE n2.nspname = 'public'
1230 -- AND cl.relname = 'test'
1231 -- AND a.attname = 'id'
1232 ORDER BY starelid, staattnum)
1237 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1238 SELECT * FROM work_v;
1239 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1240 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+------------------------+------------+------------
1241 public | pt0 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1242 public | pt0_idx | 2 | 0 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1243 public | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2} | (null) | (null)
1244 public | st0 | 1 | 2 | 1 | 1 | name | pg_catalog | bpchar | 9 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {"test "} | (null) | (null)
1245 public | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1246 public | st1 | 45 | 10000 | 45 | 45 | str | pg_catalog | text | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {1,0,2} | (null) | (null)
1247 public | st1 | 45 | 10000 | 45 | 45 | val | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,0,2} | (null) | (null)
1248 public | st1_exp | 30 | 10000 | 0 | 30 | lower | pg_catalog | text | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,0,2} | (null) | (null)
1249 public | st1_idx | 30 | 10000 | 0 | 30 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1250 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null)
1251 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2} | (null) | (null)
1252 s0 | smv0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {10,20} | (null) | (null)
1253 s0 | smv0 | 1 | 2 | 1 | 1 | txt | pg_catalog | text | -1 | f | -3 | -3 | -3 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-3,22} | {-3,23} | {-3,24} | {-3,21} | {-3,25} | (null) | (null) | {1,test} | (null) | (null)
1254 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
1255 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
1256 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
1257 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20,40,50,60} | (null) | (null) | (null) | (null)
1258 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1259 s0 | st1 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {4,5,6} | (null) | (null)
1260 s0 | st1 | 1 | 3 | 1 | 1 | num | pg_catalog | int4 | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {40,50,60} | (null) | (null)
1261 s0 | st1_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1262 s0 | st2 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3} | (null) | (null)
1263 s0 | st2 | 1 | 3 | 1 | 1 | txt | pg_catalog | text | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {1,comment,test} | (null) | (null)
1264 s0 | st2_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1265 s0 | st3 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1266 s1 | st0 | 1 | 4 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3,4} | (null) | (null)
1267 s1 | st0 | 1 | 4 | 1 | 1 | num | pg_catalog | int4 | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {15,25,35,45} | (null) | (null)
1270 TRUNCATE dbms_stats.work;
1272 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1273 \i doc/export_effective_stats-9.3.sql.sample_test
1275 * If you want the statistics of per-relation or per-column, please modify
1276 * nspname, relname, and attname in 'WHERE' clause.
1278 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1280 * If you want to chage the output file name, please modify the following name.
1283 COPY (SELECT n2.nspname,
1291 COALESCE(a.attname, ''),
1292 n1.nspname AS schemaname_of_atttype,
1319 FROM dbms_stats.column_stats_effective co
1321 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1323 ON a.atttypid = t.oid
1324 JOIN pg_namespace n1
1325 ON t.typnamespace = n1.oid
1326 RIGHT JOIN dbms_stats.relation_stats_effective r
1327 ON co.starelid = r.relid
1328 JOIN pg_catalog.pg_class cl
1330 JOIN pg_catalog.pg_namespace n2
1331 ON cl.relnamespace = n2.oid
1332 -- WHERE n2.nspname = 'public'
1333 -- AND cl.relname = 'test'
1334 -- AND a.attname = 'id'
1335 WHERE n2.nspname = 's0'
1336 ORDER BY starelid, staattnum)
1341 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1342 SELECT * FROM work_v;
1343 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1344 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+------------------------+------------+------------
1345 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null)
1346 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2} | (null) | (null)
1347 s0 | smv0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {10,20} | (null) | (null)
1348 s0 | smv0 | 1 | 2 | 1 | 1 | txt | pg_catalog | text | -1 | f | -3 | -3 | -3 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-3,22} | {-3,23} | {-3,24} | {-3,21} | {-3,25} | (null) | (null) | {1,test} | (null) | (null)
1349 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
1350 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
1351 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
1352 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20,40,50,60} | (null) | (null) | (null) | (null)
1353 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1354 s0 | st1 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {4,5,6} | (null) | (null)
1355 s0 | st1 | 1 | 3 | 1 | 1 | num | pg_catalog | int4 | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {40,50,60} | (null) | (null)
1356 s0 | st1_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1357 s0 | st2 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3} | (null) | (null)
1358 s0 | st2 | 1 | 3 | 1 | 1 | txt | pg_catalog | text | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {1,comment,test} | (null) | (null)
1359 s0 | st2_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1360 s0 | st3 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1363 \! rm doc/export_effective_stats-9.3.sql.sample_test
1364 TRUNCATE dbms_stats.work;
1366 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'st0\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1367 \i doc/export_effective_stats-9.3.sql.sample_test
1369 * If you want the statistics of per-relation or per-column, please modify
1370 * nspname, relname, and attname in 'WHERE' clause.
1372 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1374 * If you want to chage the output file name, please modify the following name.
1377 COPY (SELECT n2.nspname,
1385 COALESCE(a.attname, ''),
1386 n1.nspname AS schemaname_of_atttype,
1413 FROM dbms_stats.column_stats_effective co
1415 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1417 ON a.atttypid = t.oid
1418 JOIN pg_namespace n1
1419 ON t.typnamespace = n1.oid
1420 RIGHT JOIN dbms_stats.relation_stats_effective r
1421 ON co.starelid = r.relid
1422 JOIN pg_catalog.pg_class cl
1424 JOIN pg_catalog.pg_namespace n2
1425 ON cl.relnamespace = n2.oid
1426 -- WHERE n2.nspname = 'public'
1427 -- AND cl.relname = 'test'
1428 -- AND a.attname = 'id'
1429 WHERE cl.relname = 'st0'
1430 ORDER BY starelid, staattnum)
1435 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1436 SELECT * FROM work_v;
1437 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1438 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+---------------+------------+------------
1439 public | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2} | (null) | (null)
1440 public | st0 | 1 | 2 | 1 | 1 | name | pg_catalog | bpchar | 9 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {"test "} | (null) | (null)
1441 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
1442 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
1443 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20} | (null) | (null) | (null) | (null)
1444 s0 | st0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {10,20,40,50,60} | (null) | (null) | (null) | (null)
1445 s1 | st0 | 1 | 4 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3,4} | (null) | (null)
1446 s1 | st0 | 1 | 4 | 1 | 1 | num | pg_catalog | int4 | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {15,25,35,45} | (null) | (null)
1449 \! rm doc/export_effective_stats-9.3.sql.sample_test
1450 TRUNCATE dbms_stats.work;
1452 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'pg_toast_1262\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1453 \i doc/export_effective_stats-9.3.sql.sample_test
1455 * If you want the statistics of per-relation or per-column, please modify
1456 * nspname, relname, and attname in 'WHERE' clause.
1458 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1460 * If you want to chage the output file name, please modify the following name.
1463 COPY (SELECT n2.nspname,
1471 COALESCE(a.attname, ''),
1472 n1.nspname AS schemaname_of_atttype,
1499 FROM dbms_stats.column_stats_effective co
1501 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1503 ON a.atttypid = t.oid
1504 JOIN pg_namespace n1
1505 ON t.typnamespace = n1.oid
1506 RIGHT JOIN dbms_stats.relation_stats_effective r
1507 ON co.starelid = r.relid
1508 JOIN pg_catalog.pg_class cl
1510 JOIN pg_catalog.pg_namespace n2
1511 ON cl.relnamespace = n2.oid
1512 -- WHERE n2.nspname = 'public'
1513 -- AND cl.relname = 'test'
1514 -- AND a.attname = 'id'
1515 WHERE cl.relname = 'pg_toast_1262'
1516 ORDER BY starelid, staattnum)
1521 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1522 SELECT * FROM work_v;
1523 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1524 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1527 \! rm doc/export_effective_stats-9.3.sql.sample_test
1528 TRUNCATE dbms_stats.work;
1530 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'st0_idx\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1531 \i doc/export_effective_stats-9.3.sql.sample_test
1533 * If you want the statistics of per-relation or per-column, please modify
1534 * nspname, relname, and attname in 'WHERE' clause.
1536 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1538 * If you want to chage the output file name, please modify the following name.
1541 COPY (SELECT n2.nspname,
1549 COALESCE(a.attname, ''),
1550 n1.nspname AS schemaname_of_atttype,
1577 FROM dbms_stats.column_stats_effective co
1579 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1581 ON a.atttypid = t.oid
1582 JOIN pg_namespace n1
1583 ON t.typnamespace = n1.oid
1584 RIGHT JOIN dbms_stats.relation_stats_effective r
1585 ON co.starelid = r.relid
1586 JOIN pg_catalog.pg_class cl
1588 JOIN pg_catalog.pg_namespace n2
1589 ON cl.relnamespace = n2.oid
1590 -- WHERE n2.nspname = 'public'
1591 -- AND cl.relname = 'test'
1592 -- AND a.attname = 'id'
1593 WHERE cl.relname = 'st0_idx'
1594 ORDER BY starelid, staattnum)
1599 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1600 SELECT * FROM work_v;
1601 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1602 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1603 public | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1604 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
1607 \! rm doc/export_effective_stats-9.3.sql.sample_test
1608 TRUNCATE dbms_stats.work;
1610 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'ss0\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1611 \i doc/export_effective_stats-9.3.sql.sample_test
1613 * If you want the statistics of per-relation or per-column, please modify
1614 * nspname, relname, and attname in 'WHERE' clause.
1616 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1618 * If you want to chage the output file name, please modify the following name.
1621 COPY (SELECT n2.nspname,
1629 COALESCE(a.attname, ''),
1630 n1.nspname AS schemaname_of_atttype,
1657 FROM dbms_stats.column_stats_effective co
1659 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1661 ON a.atttypid = t.oid
1662 JOIN pg_namespace n1
1663 ON t.typnamespace = n1.oid
1664 RIGHT JOIN dbms_stats.relation_stats_effective r
1665 ON co.starelid = r.relid
1666 JOIN pg_catalog.pg_class cl
1668 JOIN pg_catalog.pg_namespace n2
1669 ON cl.relnamespace = n2.oid
1670 -- WHERE n2.nspname = 'public'
1671 -- AND cl.relname = 'test'
1672 -- AND a.attname = 'id'
1673 WHERE cl.relname = 'ss0'
1674 ORDER BY starelid, staattnum)
1679 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1680 SELECT * FROM work_v;
1681 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1682 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1685 \! rm doc/export_effective_stats-9.3.sql.sample_test
1686 TRUNCATE dbms_stats.work;
1688 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'sc0\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1689 \i doc/export_effective_stats-9.3.sql.sample_test
1691 * If you want the statistics of per-relation or per-column, please modify
1692 * nspname, relname, and attname in 'WHERE' clause.
1694 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1696 * If you want to chage the output file name, please modify the following name.
1699 COPY (SELECT n2.nspname,
1707 COALESCE(a.attname, ''),
1708 n1.nspname AS schemaname_of_atttype,
1735 FROM dbms_stats.column_stats_effective co
1737 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1739 ON a.atttypid = t.oid
1740 JOIN pg_namespace n1
1741 ON t.typnamespace = n1.oid
1742 RIGHT JOIN dbms_stats.relation_stats_effective r
1743 ON co.starelid = r.relid
1744 JOIN pg_catalog.pg_class cl
1746 JOIN pg_catalog.pg_namespace n2
1747 ON cl.relnamespace = n2.oid
1748 -- WHERE n2.nspname = 'public'
1749 -- AND cl.relname = 'test'
1750 -- AND a.attname = 'id'
1751 WHERE cl.relname = 'sc0'
1752 ORDER BY starelid, staattnum)
1757 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1758 SELECT * FROM work_v;
1759 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1760 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1763 \! rm doc/export_effective_stats-9.3.sql.sample_test
1764 TRUNCATE dbms_stats.work;
1766 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'sft0\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1767 \i doc/export_effective_stats-9.3.sql.sample_test
1769 * If you want the statistics of per-relation or per-column, please modify
1770 * nspname, relname, and attname in 'WHERE' clause.
1772 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1774 * If you want to chage the output file name, please modify the following name.
1777 COPY (SELECT n2.nspname,
1785 COALESCE(a.attname, ''),
1786 n1.nspname AS schemaname_of_atttype,
1813 FROM dbms_stats.column_stats_effective co
1815 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1817 ON a.atttypid = t.oid
1818 JOIN pg_namespace n1
1819 ON t.typnamespace = n1.oid
1820 RIGHT JOIN dbms_stats.relation_stats_effective r
1821 ON co.starelid = r.relid
1822 JOIN pg_catalog.pg_class cl
1824 JOIN pg_catalog.pg_namespace n2
1825 ON cl.relnamespace = n2.oid
1826 -- WHERE n2.nspname = 'public'
1827 -- AND cl.relname = 'test'
1828 -- AND a.attname = 'id'
1829 WHERE cl.relname = 'sft0'
1830 ORDER BY starelid, staattnum)
1835 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1836 SELECT * FROM work_v;
1837 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1838 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------------------+------------+------------
1839 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null)
1842 \! rm doc/export_effective_stats-9.3.sql.sample_test
1843 TRUNCATE dbms_stats.work;
1845 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'smv0\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1846 \i doc/export_effective_stats-9.3.sql.sample_test
1848 * If you want the statistics of per-relation or per-column, please modify
1849 * nspname, relname, and attname in 'WHERE' clause.
1851 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1853 * If you want to chage the output file name, please modify the following name.
1856 COPY (SELECT n2.nspname,
1864 COALESCE(a.attname, ''),
1865 n1.nspname AS schemaname_of_atttype,
1892 FROM dbms_stats.column_stats_effective co
1894 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1896 ON a.atttypid = t.oid
1897 JOIN pg_namespace n1
1898 ON t.typnamespace = n1.oid
1899 RIGHT JOIN dbms_stats.relation_stats_effective r
1900 ON co.starelid = r.relid
1901 JOIN pg_catalog.pg_class cl
1903 JOIN pg_catalog.pg_namespace n2
1904 ON cl.relnamespace = n2.oid
1905 -- WHERE n2.nspname = 'public'
1906 -- AND cl.relname = 'test'
1907 -- AND a.attname = 'id'
1908 WHERE cl.relname = 'smv0'
1909 ORDER BY starelid, staattnum)
1914 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1915 SELECT * FROM work_v;
1916 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1917 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1918 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2} | (null) | (null)
1919 s0 | smv0 | 1 | 2 | 1 | 1 | num | pg_catalog | int4 | -1 | f | -2 | -2 | -2 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-2,22} | {-2,23} | {-2,24} | {-2,21} | {-2,25} | (null) | (null) | {10,20} | (null) | (null)
1920 s0 | smv0 | 1 | 2 | 1 | 1 | txt | pg_catalog | text | -1 | f | -3 | -3 | -3 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-3,22} | {-3,23} | {-3,24} | {-3,21} | {-3,25} | (null) | (null) | {1,test} | (null) | (null)
1923 \! rm doc/export_effective_stats-9.3.sql.sample_test
1924 TRUNCATE dbms_stats.work;
1926 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'"' AND a.attname = '"\'id\'" doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
1927 \i doc/export_effective_stats-9.3.sql.sample_test
1929 * If you want the statistics of per-relation or per-column, please modify
1930 * nspname, relname, and attname in 'WHERE' clause.
1932 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1934 * If you want to chage the output file name, please modify the following name.
1937 COPY (SELECT n2.nspname,
1945 COALESCE(a.attname, ''),
1946 n1.nspname AS schemaname_of_atttype,
1973 FROM dbms_stats.column_stats_effective co
1975 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1977 ON a.atttypid = t.oid
1978 JOIN pg_namespace n1
1979 ON t.typnamespace = n1.oid
1980 RIGHT JOIN dbms_stats.relation_stats_effective r
1981 ON co.starelid = r.relid
1982 JOIN pg_catalog.pg_class cl
1984 JOIN pg_catalog.pg_namespace n2
1985 ON cl.relnamespace = n2.oid
1986 -- WHERE n2.nspname = 'public'
1987 -- AND cl.relname = 'test'
1988 -- AND a.attname = 'id'
1989 WHERE n2.nspname = 's0' AND a.attname = 'id'
1990 ORDER BY starelid, staattnum)
1995 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1996 SELECT * FROM work_v;
1997 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
1998 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+-------------+------------+------------------------+------------+------------
1999 s0 | sft0 | 1 | 10 | 0 | 0 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3,4,5,6,7,8,9,10} | (null) | (null)
2000 s0 | smv0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2} | (null) | (null)
2001 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2} | (null) | (null) | (null) | (null)
2002 s0 | st0 | 1 | 2 | 1 | 1 | id | pg_catalog | int4 | -1 | t | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | (null) | {1} | (null) | (null) | (null) | {1,2,4,5,6} | (null) | (null) | (null) | (null)
2003 s0 | st1 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {4,5,6} | (null) | (null)
2004 s0 | st2 | 1 | 3 | 1 | 1 | id | pg_catalog | int4 | -1 | f | -1 | -1 | -1 | 2 | 3 | 4 | 1 | 5 | 22 | 23 | 24 | 21 | 25 | {-1,22} | {-1,23} | {-1,24} | {-1,21} | {-1,25} | (null) | (null) | {1,2,3} | (null) | (null)
2007 \! rm doc/export_effective_stats-9.3.sql.sample_test
2008 TRUNCATE dbms_stats.work;
2010 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'"' AND a.attname IS NULL' doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
2011 \i doc/export_effective_stats-9.3.sql.sample_test
2013 * If you want the statistics of per-relation or per-column, please modify
2014 * nspname, relname, and attname in 'WHERE' clause.
2016 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
2018 * If you want to chage the output file name, please modify the following name.
2021 COPY (SELECT n2.nspname,
2029 COALESCE(a.attname, ''),
2030 n1.nspname AS schemaname_of_atttype,
2057 FROM dbms_stats.column_stats_effective co
2059 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
2061 ON a.atttypid = t.oid
2062 JOIN pg_namespace n1
2063 ON t.typnamespace = n1.oid
2064 RIGHT JOIN dbms_stats.relation_stats_effective r
2065 ON co.starelid = r.relid
2066 JOIN pg_catalog.pg_class cl
2068 JOIN pg_catalog.pg_namespace n2
2069 ON cl.relnamespace = n2.oid
2070 -- WHERE n2.nspname = 'public'
2071 -- AND cl.relname = 'test'
2072 -- AND a.attname = 'id'
2073 WHERE n2.nspname = 's0' AND a.attname IS NULL
2074 ORDER BY starelid, staattnum)
2079 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
2080 SELECT * FROM work_v;
2081 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
2082 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
2083 s0 | st0_idx | 2 | 2 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
2084 s0 | st1_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
2085 s0 | st2_idx | 2 | 3 | 0 | 2 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
2086 s0 | st3 | 0 | 0 | 0 | 0 | | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null) | (null)
2089 \! rm doc/export_effective_stats-9.3.sql.sample_test
2090 TRUNCATE dbms_stats.work;
2092 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'"' AND cl.relname IS NULL' doc/export_effective_stats-9.3.sql.sample > doc/export_effective_stats-9.3.sql.sample_test
2093 \i doc/export_effective_stats-9.3.sql.sample_test
2095 * If you want the statistics of per-relation or per-column, please modify
2096 * nspname, relname, and attname in 'WHERE' clause.
2098 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
2100 * If you want to chage the output file name, please modify the following name.
2103 COPY (SELECT n2.nspname,
2111 COALESCE(a.attname, ''),
2112 n1.nspname AS schemaname_of_atttype,
2139 FROM dbms_stats.column_stats_effective co
2141 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
2143 ON a.atttypid = t.oid
2144 JOIN pg_namespace n1
2145 ON t.typnamespace = n1.oid
2146 RIGHT JOIN dbms_stats.relation_stats_effective r
2147 ON co.starelid = r.relid
2148 JOIN pg_catalog.pg_class cl
2150 JOIN pg_catalog.pg_namespace n2
2151 ON cl.relnamespace = n2.oid
2152 -- WHERE n2.nspname = 'public'
2153 -- AND cl.relname = 'test'
2154 -- AND a.attname = 'id'
2155 WHERE n2.nspname = 's0' AND cl.relname IS NULL
2156 ORDER BY starelid, staattnum)
2161 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
2162 SELECT * FROM work_v;
2163 nspname | relname | relpages | reltuples | relallvisible | curpages | attname | nspname_of_typename | typname | atttypmod | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
2164 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
2167 \! rm doc/export_effective_stats-9.3.sql.sample_test
2168 TRUNCATE dbms_stats.work;
2170 * Stab function dbms_stats.import
2172 ALTER FUNCTION dbms_stats.import(
2177 ) RENAME TO truth_import;
2178 CREATE FUNCTION dbms_stats.import(
2186 RAISE NOTICE 'arguments are "%", "%", "%", "%"', $1, $2, $3, $4;
2192 * No.17-1 dbms_stats.import_database_stats(src)
2195 SELECT dbms_stats.import_database_stats('@abs_srcdir@/export_stats.dmp');
2196 NOTICE: arguments are "<NULL>", "<NULL>", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2197 import_database_stats
2198 -----------------------
2203 * No.17-2 dbms_stats.import_schema_stats(schemaname, src)
2206 SELECT dbms_stats.import_schema_stats('s0', '@abs_srcdir@/export_stats.dmp');
2207 NOTICE: arguments are "s0", "<NULL>", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2209 ---------------------
2214 * No.17-3 dbms_stats.import_table_stats(relid, src)
2217 SELECT dbms_stats.import_table_stats('s0.st0', '@abs_srcdir@/export_stats.dmp');
2218 NOTICE: arguments are "<NULL>", "s0.st0", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2220 --------------------
2225 * No.17-4 dbms_stats.import_table_stats(schemaname, tablename, src)
2228 SELECT dbms_stats.import_table_stats('s0', 'st0', '@abs_srcdir@/export_stats.dmp');
2229 NOTICE: arguments are "<NULL>", "s0.st0", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2231 --------------------
2236 * No.17-5 dbms_stats.import_column_stats (relid, attname, src)
2239 SELECT dbms_stats.import_column_stats('s0.st0', 'id', '@abs_srcdir@/export_stats.dmp');
2240 NOTICE: arguments are "<NULL>", "s0.st0", "id", "@abs_srcdir@/export_stats.dmp"
2242 ---------------------
2247 * No.17-6 dbms_stats.import_column_stats (schemaname, tablename, attname, src)
2250 SELECT dbms_stats.import_column_stats('s0', 'st0', 'id','@abs_srcdir@/export_stats.dmp');
2251 NOTICE: arguments are "<NULL>", "s0.st0", "id", "@abs_srcdir@/export_stats.dmp"
2253 ---------------------
2258 * Delete stab function dbms_stats.import
2260 DROP FUNCTION dbms_stats.import(
2266 ALTER FUNCTION dbms_stats.truth_import(