4 * No.16-1 export_plain_stats-12.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,
53 stanumbers1 = ARRAY[-staattnum,22],
54 stanumbers2 = ARRAY[-staattnum,23],
55 stanumbers3 = ARRAY[-staattnum,24],
56 stanumbers4 = ARRAY[-staattnum,21],
57 stanumbers5 = ARRAY[-staattnum,25],
58 stavalues1 = stavalues3,
59 stavalues2 = stavalues2,
60 stavalues3 = stavalues1,
61 stavalues4 = stavalues4,
62 stavalues5 = stavalues5;
63 \i doc/export_plain_stats-12.sql.sample
65 * If you want the statistics of per-relation or per-column, please modify
66 * nspname, relname, and attname in 'WHERE' clause.
68 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
70 * If you want to chage the output file name, please modify the following name.
73 COPY (SELECT n2.nspname,
78 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
80 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
82 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
84 COALESCE(a.attname, ''),
85 n1.nspname AS schemaname_of_atttype,
119 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
121 ON a.atttypid = t.oid
123 ON t.typnamespace = n1.oid
124 RIGHT JOIN pg_catalog.pg_class c
125 ON s.starelid = c.oid
126 JOIN pg_catalog.pg_namespace n2
127 ON c.relnamespace = n2.oid
128 WHERE c.relkind IN ('r', 'i', 'f', 'm')
129 AND NOT n2.nspname IN ('pg_catalog',
131 'information_schema',
133 -- AND n2.nspname = 'public'
134 -- AND c.relname = 'test'
135 -- AND a.attname = 'id'
136 ORDER BY starelid, staattnum)
141 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
142 SELECT * FROM work_v;
143 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
144 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+------------------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
145 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)
146 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)
147 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)
148 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)
149 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)
150 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)
151 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)
152 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)
153 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)
154 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)
155 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)
156 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)
157 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)
158 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)
159 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)
160 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)
161 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)
162 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)
163 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)
164 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)
165 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)
166 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)
167 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)
168 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)
169 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)
170 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)
171 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)
174 TRUNCATE dbms_stats.work;
176 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s0\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
177 \i doc/export_plain_stats-12.sql.sample_test
179 * If you want the statistics of per-relation or per-column, please modify
180 * nspname, relname, and attname in 'WHERE' clause.
182 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
184 * If you want to chage the output file name, please modify the following name.
187 COPY (SELECT n2.nspname,
192 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
194 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
196 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
198 COALESCE(a.attname, ''),
199 n1.nspname AS schemaname_of_atttype,
233 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
235 ON a.atttypid = t.oid
237 ON t.typnamespace = n1.oid
238 RIGHT JOIN pg_catalog.pg_class c
239 ON s.starelid = c.oid
240 JOIN pg_catalog.pg_namespace n2
241 ON c.relnamespace = n2.oid
242 WHERE c.relkind IN ('r', 'i', 'f', 'm')
243 AND NOT n2.nspname IN ('pg_catalog',
245 'information_schema',
247 -- AND n2.nspname = 'public'
248 -- AND c.relname = 'test'
249 -- AND a.attname = 'id'
250 AND n2.nspname = 's0'
251 ORDER BY starelid, staattnum)
256 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
257 SELECT * FROM work_v;
258 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
259 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
260 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)
261 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)
262 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)
263 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)
264 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)
265 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)
266 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)
267 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)
268 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)
269 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)
270 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)
271 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)
272 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)
273 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)
274 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)
275 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)
278 TRUNCATE dbms_stats.work;
279 \! rm doc/export_plain_stats-12.sql.sample_test
281 \! sed '/ORDER/i\\ AND c.relname = '"\'st0\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
282 \i doc/export_plain_stats-12.sql.sample_test
284 * If you want the statistics of per-relation or per-column, please modify
285 * nspname, relname, and attname in 'WHERE' clause.
287 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
289 * If you want to chage the output file name, please modify the following name.
292 COPY (SELECT n2.nspname,
297 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
299 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
301 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
303 COALESCE(a.attname, ''),
304 n1.nspname AS schemaname_of_atttype,
338 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
340 ON a.atttypid = t.oid
342 ON t.typnamespace = n1.oid
343 RIGHT JOIN pg_catalog.pg_class c
344 ON s.starelid = c.oid
345 JOIN pg_catalog.pg_namespace n2
346 ON c.relnamespace = n2.oid
347 WHERE c.relkind IN ('r', 'i', 'f', 'm')
348 AND NOT n2.nspname IN ('pg_catalog',
350 'information_schema',
352 -- AND n2.nspname = 'public'
353 -- AND c.relname = 'test'
354 -- AND a.attname = 'id'
355 AND c.relname = 'st0'
356 ORDER BY starelid, staattnum)
361 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
362 SELECT * FROM work_v;
363 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
364 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+------------+------------+------------
365 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)
366 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)
367 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)
368 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)
369 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)
370 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)
371 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)
372 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)
375 TRUNCATE dbms_stats.work;
376 \! rm doc/export_plain_stats-12.sql.sample_test
377 -- No.16-1-3-1 Actual import test
378 select dbms_stats.import_database_stats('@abs_srcdir@/export_stats.dmp');
379 import_database_stats
380 -----------------------
385 \! sed '/ORDER/i\\ AND c.relname = '"\'pg_toast_1262\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
386 \i doc/export_plain_stats-12.sql.sample_test
388 * If you want the statistics of per-relation or per-column, please modify
389 * nspname, relname, and attname in 'WHERE' clause.
391 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
393 * If you want to chage the output file name, please modify the following name.
396 COPY (SELECT n2.nspname,
401 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
403 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
405 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
407 COALESCE(a.attname, ''),
408 n1.nspname AS schemaname_of_atttype,
442 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
444 ON a.atttypid = t.oid
446 ON t.typnamespace = n1.oid
447 RIGHT JOIN pg_catalog.pg_class c
448 ON s.starelid = c.oid
449 JOIN pg_catalog.pg_namespace n2
450 ON c.relnamespace = n2.oid
451 WHERE c.relkind IN ('r', 'i', 'f', 'm')
452 AND NOT n2.nspname IN ('pg_catalog',
454 'information_schema',
456 -- AND n2.nspname = 'public'
457 -- AND c.relname = 'test'
458 -- AND a.attname = 'id'
459 AND c.relname = 'pg_toast_1262'
460 ORDER BY starelid, staattnum)
465 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
466 SELECT * FROM work_v;
467 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
468 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
471 TRUNCATE dbms_stats.work;
472 \! rm doc/export_plain_stats-12.sql.sample_test
474 \! sed '/ORDER/i\\ AND c.relname = '"\'st0_idx\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
475 \i doc/export_plain_stats-12.sql.sample_test
477 * If you want the statistics of per-relation or per-column, please modify
478 * nspname, relname, and attname in 'WHERE' clause.
480 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
482 * If you want to chage the output file name, please modify the following name.
485 COPY (SELECT n2.nspname,
490 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
492 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
494 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
496 COALESCE(a.attname, ''),
497 n1.nspname AS schemaname_of_atttype,
531 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
533 ON a.atttypid = t.oid
535 ON t.typnamespace = n1.oid
536 RIGHT JOIN pg_catalog.pg_class c
537 ON s.starelid = c.oid
538 JOIN pg_catalog.pg_namespace n2
539 ON c.relnamespace = n2.oid
540 WHERE c.relkind IN ('r', 'i', 'f', 'm')
541 AND NOT n2.nspname IN ('pg_catalog',
543 'information_schema',
545 -- AND n2.nspname = 'public'
546 -- AND c.relname = 'test'
547 -- AND a.attname = 'id'
548 AND c.relname = 'st0_idx'
549 ORDER BY starelid, staattnum)
554 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
555 SELECT * FROM work_v;
556 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
557 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
558 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)
559 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)
562 TRUNCATE dbms_stats.work;
563 \! rm doc/export_plain_stats-12.sql.sample_test
565 \! sed '/ORDER/i\\ AND c.relname = '"\'ss0\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
566 \i doc/export_plain_stats-12.sql.sample_test
568 * If you want the statistics of per-relation or per-column, please modify
569 * nspname, relname, and attname in 'WHERE' clause.
571 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
573 * If you want to chage the output file name, please modify the following name.
576 COPY (SELECT n2.nspname,
581 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
583 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
585 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
587 COALESCE(a.attname, ''),
588 n1.nspname AS schemaname_of_atttype,
622 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
624 ON a.atttypid = t.oid
626 ON t.typnamespace = n1.oid
627 RIGHT JOIN pg_catalog.pg_class c
628 ON s.starelid = c.oid
629 JOIN pg_catalog.pg_namespace n2
630 ON c.relnamespace = n2.oid
631 WHERE c.relkind IN ('r', 'i', 'f', 'm')
632 AND NOT n2.nspname IN ('pg_catalog',
634 'information_schema',
636 -- AND n2.nspname = 'public'
637 -- AND c.relname = 'test'
638 -- AND a.attname = 'id'
639 AND c.relname = 'ss0'
640 ORDER BY starelid, staattnum)
645 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
646 SELECT * FROM work_v;
647 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
648 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
651 TRUNCATE dbms_stats.work;
652 \! rm doc/export_plain_stats-12.sql.sample_test
654 \! sed '/ORDER/i\\ AND c.relname = '"\'sc0\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
655 \i doc/export_plain_stats-12.sql.sample_test
657 * If you want the statistics of per-relation or per-column, please modify
658 * nspname, relname, and attname in 'WHERE' clause.
660 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
662 * If you want to chage the output file name, please modify the following name.
665 COPY (SELECT n2.nspname,
670 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
672 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
674 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
676 COALESCE(a.attname, ''),
677 n1.nspname AS schemaname_of_atttype,
711 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
713 ON a.atttypid = t.oid
715 ON t.typnamespace = n1.oid
716 RIGHT JOIN pg_catalog.pg_class c
717 ON s.starelid = c.oid
718 JOIN pg_catalog.pg_namespace n2
719 ON c.relnamespace = n2.oid
720 WHERE c.relkind IN ('r', 'i', 'f', 'm')
721 AND NOT n2.nspname IN ('pg_catalog',
723 'information_schema',
725 -- AND n2.nspname = 'public'
726 -- AND c.relname = 'test'
727 -- AND a.attname = 'id'
728 AND c.relname = 'sc0'
729 ORDER BY starelid, staattnum)
734 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
735 SELECT * FROM work_v;
736 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
737 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
740 TRUNCATE dbms_stats.work;
741 \! rm doc/export_plain_stats-12.sql.sample_test
743 \! sed '/ORDER/i\\ AND c.relname = '"\'sft0\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
744 \i doc/export_plain_stats-12.sql.sample_test
746 * If you want the statistics of per-relation or per-column, please modify
747 * nspname, relname, and attname in 'WHERE' clause.
749 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
751 * If you want to chage the output file name, please modify the following name.
754 COPY (SELECT n2.nspname,
759 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
761 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
763 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
765 COALESCE(a.attname, ''),
766 n1.nspname AS schemaname_of_atttype,
800 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
802 ON a.atttypid = t.oid
804 ON t.typnamespace = n1.oid
805 RIGHT JOIN pg_catalog.pg_class c
806 ON s.starelid = c.oid
807 JOIN pg_catalog.pg_namespace n2
808 ON c.relnamespace = n2.oid
809 WHERE c.relkind IN ('r', 'i', 'f', 'm')
810 AND NOT n2.nspname IN ('pg_catalog',
812 'information_schema',
814 -- AND n2.nspname = 'public'
815 -- AND c.relname = 'test'
816 -- AND a.attname = 'id'
817 AND c.relname = 'sft0'
818 ORDER BY starelid, staattnum)
823 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
824 SELECT * FROM work_v;
825 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
826 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
827 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)
830 TRUNCATE dbms_stats.work;
831 \! rm doc/export_plain_stats-12.sql.sample_test
833 \! sed '/ORDER/i\\ AND c.relname = '"\'smv0\'" doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
834 \i doc/export_plain_stats-12.sql.sample_test
836 * If you want the statistics of per-relation or per-column, please modify
837 * nspname, relname, and attname in 'WHERE' clause.
839 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
841 * If you want to chage the output file name, please modify the following name.
844 COPY (SELECT n2.nspname,
849 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
851 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
853 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
855 COALESCE(a.attname, ''),
856 n1.nspname AS schemaname_of_atttype,
890 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
892 ON a.atttypid = t.oid
894 ON t.typnamespace = n1.oid
895 RIGHT JOIN pg_catalog.pg_class c
896 ON s.starelid = c.oid
897 JOIN pg_catalog.pg_namespace n2
898 ON c.relnamespace = n2.oid
899 WHERE c.relkind IN ('r', 'i', 'f', 'm')
900 AND NOT n2.nspname IN ('pg_catalog',
902 'information_schema',
904 -- AND n2.nspname = 'public'
905 -- AND c.relname = 'test'
906 -- AND a.attname = 'id'
907 AND c.relname = 'smv0'
908 ORDER BY starelid, staattnum)
913 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
914 SELECT * FROM work_v;
915 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
916 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
917 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)
918 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)
919 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)
922 TRUNCATE dbms_stats.work;
923 \! rm doc/export_plain_stats-12.sql.sample_test
925 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s0\'"' AND a.attname = '\'id\' doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
926 \i doc/export_plain_stats-12.sql.sample_test
928 * If you want the statistics of per-relation or per-column, please modify
929 * nspname, relname, and attname in 'WHERE' clause.
931 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
933 * If you want to chage the output file name, please modify the following name.
936 COPY (SELECT n2.nspname,
941 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
943 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
945 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
947 COALESCE(a.attname, ''),
948 n1.nspname AS schemaname_of_atttype,
982 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
984 ON a.atttypid = t.oid
986 ON t.typnamespace = n1.oid
987 RIGHT JOIN pg_catalog.pg_class c
988 ON s.starelid = c.oid
989 JOIN pg_catalog.pg_namespace n2
990 ON c.relnamespace = n2.oid
991 WHERE c.relkind IN ('r', 'i', 'f', 'm')
992 AND NOT n2.nspname IN ('pg_catalog',
994 'information_schema',
996 -- AND n2.nspname = 'public'
997 -- AND c.relname = 'test'
998 -- AND a.attname = 'id'
999 AND n2.nspname = 's0' AND a.attname = 'id'
1000 ORDER BY starelid, staattnum)
1005 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1006 SELECT * FROM work_v;
1007 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
1008 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------------+------------+------------+------------+------------
1009 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)
1010 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)
1011 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)
1012 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)
1013 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)
1014 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)
1017 TRUNCATE dbms_stats.work;
1018 \! rm doc/export_plain_stats-12.sql.sample_test
1020 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s0\'"' AND a.attname IS NULL' doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
1021 \i doc/export_plain_stats-12.sql.sample_test
1023 * If you want the statistics of per-relation or per-column, please modify
1024 * nspname, relname, and attname in 'WHERE' clause.
1026 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1028 * If you want to chage the output file name, please modify the following name.
1031 COPY (SELECT n2.nspname,
1036 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
1038 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
1040 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
1041 AS last_autoanalyze,
1042 COALESCE(a.attname, ''),
1043 n1.nspname AS schemaname_of_atttype,
1077 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
1079 ON a.atttypid = t.oid
1080 JOIN pg_namespace n1
1081 ON t.typnamespace = n1.oid
1082 RIGHT JOIN pg_catalog.pg_class c
1083 ON s.starelid = c.oid
1084 JOIN pg_catalog.pg_namespace n2
1085 ON c.relnamespace = n2.oid
1086 WHERE c.relkind IN ('r', 'i', 'f', 'm')
1087 AND NOT n2.nspname IN ('pg_catalog',
1089 'information_schema',
1091 -- AND n2.nspname = 'public'
1092 -- AND c.relname = 'test'
1093 -- AND a.attname = 'id'
1094 AND n2.nspname = 's0' AND a.attname IS NULL
1095 ORDER BY starelid, staattnum)
1100 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1101 SELECT * FROM work_v;
1102 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
1103 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1104 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)
1105 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)
1106 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)
1107 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)
1110 TRUNCATE dbms_stats.work;
1111 \! rm doc/export_plain_stats-12.sql.sample_test
1113 \! sed '/ORDER/i\\ AND n2.nspname = '"\'s1\'"' AND c.relname IS NULL' doc/export_plain_stats-12.sql.sample > doc/export_plain_stats-12.sql.sample_test
1114 \i doc/export_plain_stats-12.sql.sample_test
1116 * If you want the statistics of per-relation or per-column, please modify
1117 * nspname, relname, and attname in 'WHERE' clause.
1119 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1121 * If you want to chage the output file name, please modify the following name.
1124 COPY (SELECT n2.nspname,
1129 (pg_relation_size(c.oid) / current_setting('block_size')::int4)::int4
1131 pg_catalog.pg_stat_get_last_analyze_time(c.oid)
1133 pg_catalog.pg_stat_get_last_autoanalyze_time(c.oid)
1134 AS last_autoanalyze,
1135 COALESCE(a.attname, ''),
1136 n1.nspname AS schemaname_of_atttype,
1170 ON (s.starelid = a.attrelid AND s.staattnum = a.attnum)
1172 ON a.atttypid = t.oid
1173 JOIN pg_namespace n1
1174 ON t.typnamespace = n1.oid
1175 RIGHT JOIN pg_catalog.pg_class c
1176 ON s.starelid = c.oid
1177 JOIN pg_catalog.pg_namespace n2
1178 ON c.relnamespace = n2.oid
1179 WHERE c.relkind IN ('r', 'i', 'f', 'm')
1180 AND NOT n2.nspname IN ('pg_catalog',
1182 'information_schema',
1184 -- AND n2.nspname = 'public'
1185 -- AND c.relname = 'test'
1186 -- AND a.attname = 'id'
1187 AND n2.nspname = 's1' AND c.relname IS NULL
1188 ORDER BY starelid, staattnum)
1193 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1194 SELECT * FROM work_v;
1195 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
1196 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1199 TRUNCATE dbms_stats.work;
1200 \! rm doc/export_plain_stats-12.sql.sample_test
1202 * No.16-2 export_effective_stats-12.sql.sample
1206 SELECT dbms_stats.lock_database_stats();
1208 ---------------------
1228 UPDATE dbms_stats.relation_stats_locked
1229 SET (relpages, reltuples, relallvisible, curpages) = (NULL, NULL, NULL, NULL);
1230 UPDATE dbms_stats.column_stats_locked
1231 SET (stanullfrac, stawidth, stadistinct,
1232 stakind1, stakind2, stakind3, stakind4, stakind5,
1233 staop1, staop2, staop3, staop4, staop5,
1234 stacoll1, stacoll2, stacoll3, stacoll4, stacoll5,
1235 stanumbers1, stanumbers2, stanumbers3, stanumbers4, stanumbers5,
1236 stavalues1, stavalues2, stavalues3, stavalues4, stavalues5)
1237 = (NULL, NULL, NULL,
1238 NULL, NULL, NULL, NULL, NULL,
1239 NULL, NULL, NULL, NULL, NULL,
1240 NULL, NULL, NULL, NULL, NULL,
1241 NULL, NULL, NULL, NULL, NULL,
1242 NULL, NULL, NULL, NULL, NULL)
1243 WHERE starelid = 's0.st0'::regclass;
1244 \i doc/export_effective_stats-12.sql.sample
1246 * If you want the statistics of per-relation or per-column, please modify
1247 * nspname, relname, and attname in 'WHERE' clause.
1249 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1251 * If you want to chage the output file name, please modify the following name.
1254 COPY (SELECT n2.nspname,
1262 COALESCE(a.attname, ''),
1263 n1.nspname AS schemaname_of_atttype,
1295 FROM dbms_stats.column_stats_effective co
1297 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1299 ON a.atttypid = t.oid
1300 JOIN pg_namespace n1
1301 ON t.typnamespace = n1.oid
1302 RIGHT JOIN dbms_stats.relation_stats_effective r
1303 ON co.starelid = r.relid
1304 JOIN pg_catalog.pg_class cl
1306 JOIN pg_catalog.pg_namespace n2
1307 ON cl.relnamespace = n2.oid
1308 -- WHERE n2.nspname = 'public'
1309 -- AND cl.relname = 'test'
1310 -- AND a.attname = 'id'
1311 ORDER BY starelid, staattnum)
1316 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1317 SELECT * FROM work_v;
1318 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
1319 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+------------------------+------------+------------
1320 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)
1321 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)
1322 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)
1323 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)
1324 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)
1325 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)
1326 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)
1327 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)
1328 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)
1329 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)
1330 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)
1331 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)
1332 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)
1333 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)
1334 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)
1335 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)
1336 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)
1337 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)
1338 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)
1339 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)
1340 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)
1341 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)
1342 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)
1343 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)
1344 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)
1345 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)
1346 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)
1349 TRUNCATE dbms_stats.work;
1351 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1352 \i doc/export_effective_stats-12.sql.sample_test
1354 * If you want the statistics of per-relation or per-column, please modify
1355 * nspname, relname, and attname in 'WHERE' clause.
1357 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1359 * If you want to chage the output file name, please modify the following name.
1362 COPY (SELECT n2.nspname,
1370 COALESCE(a.attname, ''),
1371 n1.nspname AS schemaname_of_atttype,
1403 FROM dbms_stats.column_stats_effective co
1405 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1407 ON a.atttypid = t.oid
1408 JOIN pg_namespace n1
1409 ON t.typnamespace = n1.oid
1410 RIGHT JOIN dbms_stats.relation_stats_effective r
1411 ON co.starelid = r.relid
1412 JOIN pg_catalog.pg_class cl
1414 JOIN pg_catalog.pg_namespace n2
1415 ON cl.relnamespace = n2.oid
1416 -- WHERE n2.nspname = 'public'
1417 -- AND cl.relname = 'test'
1418 -- AND a.attname = 'id'
1419 WHERE n2.nspname = 's0'
1420 ORDER BY starelid, staattnum)
1425 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1426 SELECT * FROM work_v;
1427 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
1428 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+------------------------+------------+------------
1429 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)
1430 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)
1431 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)
1432 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)
1433 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)
1434 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)
1435 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)
1436 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)
1437 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)
1438 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)
1439 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)
1440 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)
1441 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)
1442 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)
1443 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)
1444 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)
1447 \! rm doc/export_effective_stats-12.sql.sample_test
1448 TRUNCATE dbms_stats.work;
1450 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'st0\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1451 \i doc/export_effective_stats-12.sql.sample_test
1453 * If you want the statistics of per-relation or per-column, please modify
1454 * nspname, relname, and attname in 'WHERE' clause.
1456 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1458 * If you want to chage the output file name, please modify the following name.
1461 COPY (SELECT n2.nspname,
1469 COALESCE(a.attname, ''),
1470 n1.nspname AS schemaname_of_atttype,
1502 FROM dbms_stats.column_stats_effective co
1504 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1506 ON a.atttypid = t.oid
1507 JOIN pg_namespace n1
1508 ON t.typnamespace = n1.oid
1509 RIGHT JOIN dbms_stats.relation_stats_effective r
1510 ON co.starelid = r.relid
1511 JOIN pg_catalog.pg_class cl
1513 JOIN pg_catalog.pg_namespace n2
1514 ON cl.relnamespace = n2.oid
1515 -- WHERE n2.nspname = 'public'
1516 -- AND cl.relname = 'test'
1517 -- AND a.attname = 'id'
1518 WHERE cl.relname = 'st0'
1519 ORDER BY starelid, staattnum)
1524 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1525 SELECT * FROM work_v;
1526 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
1527 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------------+------------+------------+------------+------------
1528 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)
1529 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)
1530 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)
1531 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)
1532 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)
1533 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)
1534 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)
1535 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)
1538 \! rm doc/export_effective_stats-12.sql.sample_test
1539 TRUNCATE dbms_stats.work;
1541 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'pg_toast_1262\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1542 \i doc/export_effective_stats-12.sql.sample_test
1544 * If you want the statistics of per-relation or per-column, please modify
1545 * nspname, relname, and attname in 'WHERE' clause.
1547 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1549 * If you want to chage the output file name, please modify the following name.
1552 COPY (SELECT n2.nspname,
1560 COALESCE(a.attname, ''),
1561 n1.nspname AS schemaname_of_atttype,
1593 FROM dbms_stats.column_stats_effective co
1595 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1597 ON a.atttypid = t.oid
1598 JOIN pg_namespace n1
1599 ON t.typnamespace = n1.oid
1600 RIGHT JOIN dbms_stats.relation_stats_effective r
1601 ON co.starelid = r.relid
1602 JOIN pg_catalog.pg_class cl
1604 JOIN pg_catalog.pg_namespace n2
1605 ON cl.relnamespace = n2.oid
1606 -- WHERE n2.nspname = 'public'
1607 -- AND cl.relname = 'test'
1608 -- AND a.attname = 'id'
1609 WHERE cl.relname = 'pg_toast_1262'
1610 ORDER BY starelid, staattnum)
1615 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1616 SELECT * FROM work_v;
1617 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
1618 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1621 \! rm doc/export_effective_stats-12.sql.sample_test
1622 TRUNCATE dbms_stats.work;
1624 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'st0_idx\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1625 \i doc/export_effective_stats-12.sql.sample_test
1627 * If you want the statistics of per-relation or per-column, please modify
1628 * nspname, relname, and attname in 'WHERE' clause.
1630 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1632 * If you want to chage the output file name, please modify the following name.
1635 COPY (SELECT n2.nspname,
1643 COALESCE(a.attname, ''),
1644 n1.nspname AS schemaname_of_atttype,
1676 FROM dbms_stats.column_stats_effective co
1678 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1680 ON a.atttypid = t.oid
1681 JOIN pg_namespace n1
1682 ON t.typnamespace = n1.oid
1683 RIGHT JOIN dbms_stats.relation_stats_effective r
1684 ON co.starelid = r.relid
1685 JOIN pg_catalog.pg_class cl
1687 JOIN pg_catalog.pg_namespace n2
1688 ON cl.relnamespace = n2.oid
1689 -- WHERE n2.nspname = 'public'
1690 -- AND cl.relname = 'test'
1691 -- AND a.attname = 'id'
1692 WHERE cl.relname = 'st0_idx'
1693 ORDER BY starelid, staattnum)
1698 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1699 SELECT * FROM work_v;
1700 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
1701 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1702 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)
1703 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)
1706 \! rm doc/export_effective_stats-12.sql.sample_test
1707 TRUNCATE dbms_stats.work;
1709 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'ss0\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1710 \i doc/export_effective_stats-12.sql.sample_test
1712 * If you want the statistics of per-relation or per-column, please modify
1713 * nspname, relname, and attname in 'WHERE' clause.
1715 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1717 * If you want to chage the output file name, please modify the following name.
1720 COPY (SELECT n2.nspname,
1728 COALESCE(a.attname, ''),
1729 n1.nspname AS schemaname_of_atttype,
1761 FROM dbms_stats.column_stats_effective co
1763 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1765 ON a.atttypid = t.oid
1766 JOIN pg_namespace n1
1767 ON t.typnamespace = n1.oid
1768 RIGHT JOIN dbms_stats.relation_stats_effective r
1769 ON co.starelid = r.relid
1770 JOIN pg_catalog.pg_class cl
1772 JOIN pg_catalog.pg_namespace n2
1773 ON cl.relnamespace = n2.oid
1774 -- WHERE n2.nspname = 'public'
1775 -- AND cl.relname = 'test'
1776 -- AND a.attname = 'id'
1777 WHERE cl.relname = 'ss0'
1778 ORDER BY starelid, staattnum)
1783 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1784 SELECT * FROM work_v;
1785 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
1786 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1789 \! rm doc/export_effective_stats-12.sql.sample_test
1790 TRUNCATE dbms_stats.work;
1792 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'sc0\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1793 \i doc/export_effective_stats-12.sql.sample_test
1795 * If you want the statistics of per-relation or per-column, please modify
1796 * nspname, relname, and attname in 'WHERE' clause.
1798 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1800 * If you want to chage the output file name, please modify the following name.
1803 COPY (SELECT n2.nspname,
1811 COALESCE(a.attname, ''),
1812 n1.nspname AS schemaname_of_atttype,
1844 FROM dbms_stats.column_stats_effective co
1846 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1848 ON a.atttypid = t.oid
1849 JOIN pg_namespace n1
1850 ON t.typnamespace = n1.oid
1851 RIGHT JOIN dbms_stats.relation_stats_effective r
1852 ON co.starelid = r.relid
1853 JOIN pg_catalog.pg_class cl
1855 JOIN pg_catalog.pg_namespace n2
1856 ON cl.relnamespace = n2.oid
1857 -- WHERE n2.nspname = 'public'
1858 -- AND cl.relname = 'test'
1859 -- AND a.attname = 'id'
1860 WHERE cl.relname = 'sc0'
1861 ORDER BY starelid, staattnum)
1866 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1867 SELECT * FROM work_v;
1868 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
1869 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
1872 \! rm doc/export_effective_stats-12.sql.sample_test
1873 TRUNCATE dbms_stats.work;
1875 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'sft0\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1876 \i doc/export_effective_stats-12.sql.sample_test
1878 * If you want the statistics of per-relation or per-column, please modify
1879 * nspname, relname, and attname in 'WHERE' clause.
1881 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1883 * If you want to chage the output file name, please modify the following name.
1886 COPY (SELECT n2.nspname,
1894 COALESCE(a.attname, ''),
1895 n1.nspname AS schemaname_of_atttype,
1927 FROM dbms_stats.column_stats_effective co
1929 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
1931 ON a.atttypid = t.oid
1932 JOIN pg_namespace n1
1933 ON t.typnamespace = n1.oid
1934 RIGHT JOIN dbms_stats.relation_stats_effective r
1935 ON co.starelid = r.relid
1936 JOIN pg_catalog.pg_class cl
1938 JOIN pg_catalog.pg_namespace n2
1939 ON cl.relnamespace = n2.oid
1940 -- WHERE n2.nspname = 'public'
1941 -- AND cl.relname = 'test'
1942 -- AND a.attname = 'id'
1943 WHERE cl.relname = 'sft0'
1944 ORDER BY starelid, staattnum)
1949 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
1950 SELECT * FROM work_v;
1951 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
1952 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------------------+------------+------------
1953 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)
1956 \! rm doc/export_effective_stats-12.sql.sample_test
1957 TRUNCATE dbms_stats.work;
1959 \! sed '/ORDER/i\\ WHERE cl.relname = '"\'smv0\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
1960 \i doc/export_effective_stats-12.sql.sample_test
1962 * If you want the statistics of per-relation or per-column, please modify
1963 * nspname, relname, and attname in 'WHERE' clause.
1965 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1967 * If you want to chage the output file name, please modify the following name.
1970 COPY (SELECT n2.nspname,
1978 COALESCE(a.attname, ''),
1979 n1.nspname AS schemaname_of_atttype,
2011 FROM dbms_stats.column_stats_effective co
2013 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
2015 ON a.atttypid = t.oid
2016 JOIN pg_namespace n1
2017 ON t.typnamespace = n1.oid
2018 RIGHT JOIN dbms_stats.relation_stats_effective r
2019 ON co.starelid = r.relid
2020 JOIN pg_catalog.pg_class cl
2022 JOIN pg_catalog.pg_namespace n2
2023 ON cl.relnamespace = n2.oid
2024 -- WHERE n2.nspname = 'public'
2025 -- AND cl.relname = 'test'
2026 -- AND a.attname = 'id'
2027 WHERE cl.relname = 'smv0'
2028 ORDER BY starelid, staattnum)
2033 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
2034 SELECT * FROM work_v;
2035 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
2036 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
2037 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)
2038 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)
2039 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)
2042 \! rm doc/export_effective_stats-12.sql.sample_test
2043 TRUNCATE dbms_stats.work;
2045 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'"' AND a.attname = '"\'id\'" doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
2046 \i doc/export_effective_stats-12.sql.sample_test
2048 * If you want the statistics of per-relation or per-column, please modify
2049 * nspname, relname, and attname in 'WHERE' clause.
2051 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
2053 * If you want to chage the output file name, please modify the following name.
2056 COPY (SELECT n2.nspname,
2064 COALESCE(a.attname, ''),
2065 n1.nspname AS schemaname_of_atttype,
2097 FROM dbms_stats.column_stats_effective co
2099 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
2101 ON a.atttypid = t.oid
2102 JOIN pg_namespace n1
2103 ON t.typnamespace = n1.oid
2104 RIGHT JOIN dbms_stats.relation_stats_effective r
2105 ON co.starelid = r.relid
2106 JOIN pg_catalog.pg_class cl
2108 JOIN pg_catalog.pg_namespace n2
2109 ON cl.relnamespace = n2.oid
2110 -- WHERE n2.nspname = 'public'
2111 -- AND cl.relname = 'test'
2112 -- AND a.attname = 'id'
2113 WHERE n2.nspname = 's0' AND a.attname = 'id'
2114 ORDER BY starelid, staattnum)
2119 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
2120 SELECT * FROM work_v;
2121 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
2122 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+-------------+------------+------------------------+------------+------------
2123 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)
2124 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)
2125 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)
2126 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)
2127 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)
2128 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)
2131 \! rm doc/export_effective_stats-12.sql.sample_test
2132 TRUNCATE dbms_stats.work;
2134 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'"' AND a.attname IS NULL' doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
2135 \i doc/export_effective_stats-12.sql.sample_test
2137 * If you want the statistics of per-relation or per-column, please modify
2138 * nspname, relname, and attname in 'WHERE' clause.
2140 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
2142 * If you want to chage the output file name, please modify the following name.
2145 COPY (SELECT n2.nspname,
2153 COALESCE(a.attname, ''),
2154 n1.nspname AS schemaname_of_atttype,
2186 FROM dbms_stats.column_stats_effective co
2188 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
2190 ON a.atttypid = t.oid
2191 JOIN pg_namespace n1
2192 ON t.typnamespace = n1.oid
2193 RIGHT JOIN dbms_stats.relation_stats_effective r
2194 ON co.starelid = r.relid
2195 JOIN pg_catalog.pg_class cl
2197 JOIN pg_catalog.pg_namespace n2
2198 ON cl.relnamespace = n2.oid
2199 -- WHERE n2.nspname = 'public'
2200 -- AND cl.relname = 'test'
2201 -- AND a.attname = 'id'
2202 WHERE n2.nspname = 's0' AND a.attname IS NULL
2203 ORDER BY starelid, staattnum)
2208 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
2209 SELECT * FROM work_v;
2210 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
2211 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
2212 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)
2213 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)
2214 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)
2215 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)
2218 \! rm doc/export_effective_stats-12.sql.sample_test
2219 TRUNCATE dbms_stats.work;
2221 \! sed '/ORDER/i\\ WHERE n2.nspname = '"\'s0\'"' AND cl.relname IS NULL' doc/export_effective_stats-12.sql.sample > doc/export_effective_stats-12.sql.sample_test
2222 \i doc/export_effective_stats-12.sql.sample_test
2224 * If you want the statistics of per-relation or per-column, please modify
2225 * nspname, relname, and attname in 'WHERE' clause.
2227 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
2229 * If you want to chage the output file name, please modify the following name.
2232 COPY (SELECT n2.nspname,
2240 COALESCE(a.attname, ''),
2241 n1.nspname AS schemaname_of_atttype,
2273 FROM dbms_stats.column_stats_effective co
2275 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
2277 ON a.atttypid = t.oid
2278 JOIN pg_namespace n1
2279 ON t.typnamespace = n1.oid
2280 RIGHT JOIN dbms_stats.relation_stats_effective r
2281 ON co.starelid = r.relid
2282 JOIN pg_catalog.pg_class cl
2284 JOIN pg_catalog.pg_namespace n2
2285 ON cl.relnamespace = n2.oid
2286 -- WHERE n2.nspname = 'public'
2287 -- AND cl.relname = 'test'
2288 -- AND a.attname = 'id'
2289 WHERE n2.nspname = 's0' AND cl.relname IS NULL
2290 ORDER BY starelid, staattnum)
2295 COPY dbms_stats.work FROM '@abs_srcdir@/export_stats.dmp' (FORMAT 'binary');
2296 SELECT * FROM work_v;
2297 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
2298 ---------+---------+----------+-----------+---------------+----------+---------+---------------------+---------+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+-------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------+------------
2301 \! rm doc/export_effective_stats-12.sql.sample_test
2302 TRUNCATE dbms_stats.work;
2304 * Stab function dbms_stats.import
2306 ALTER FUNCTION dbms_stats.import(
2311 ) RENAME TO truth_import;
2312 CREATE FUNCTION dbms_stats.import(
2320 RAISE NOTICE 'arguments are "%", "%", "%", "%"', $1, $2, $3, $4;
2326 * No.17-1 dbms_stats.import_database_stats(src)
2329 SELECT dbms_stats.import_database_stats('@abs_srcdir@/export_stats.dmp');
2330 NOTICE: arguments are "<NULL>", "<NULL>", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2331 import_database_stats
2332 -----------------------
2337 * No.17-2 dbms_stats.import_schema_stats(schemaname, src)
2340 SELECT dbms_stats.import_schema_stats('s0', '@abs_srcdir@/export_stats.dmp');
2341 NOTICE: arguments are "s0", "<NULL>", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2343 ---------------------
2348 * No.17-3 dbms_stats.import_table_stats(relid, src)
2351 SELECT dbms_stats.import_table_stats('s0.st0', '@abs_srcdir@/export_stats.dmp');
2352 NOTICE: arguments are "<NULL>", "s0.st0", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2354 --------------------
2359 * No.17-4 dbms_stats.import_table_stats(schemaname, tablename, src)
2362 SELECT dbms_stats.import_table_stats('s0', 'st0', '@abs_srcdir@/export_stats.dmp');
2363 NOTICE: arguments are "<NULL>", "s0.st0", "<NULL>", "@abs_srcdir@/export_stats.dmp"
2365 --------------------
2370 * No.17-5 dbms_stats.import_column_stats (relid, attname, src)
2373 SELECT dbms_stats.import_column_stats('s0.st0', 'id', '@abs_srcdir@/export_stats.dmp');
2374 NOTICE: arguments are "<NULL>", "s0.st0", "id", "@abs_srcdir@/export_stats.dmp"
2376 ---------------------
2381 * No.17-6 dbms_stats.import_column_stats (schemaname, tablename, attname, src)
2384 SELECT dbms_stats.import_column_stats('s0', 'st0', 'id','@abs_srcdir@/export_stats.dmp');
2385 NOTICE: arguments are "<NULL>", "s0.st0", "id", "@abs_srcdir@/export_stats.dmp"
2387 ---------------------
2392 * Delete stab function dbms_stats.import
2394 DROP FUNCTION dbms_stats.import(
2400 ALTER FUNCTION dbms_stats.truth_import(