OSDN Git Service

8月22日消化分の試験を追加した。
[pghintplan/pg_hint_plan.git] / expected / ut-init.out
1 SET search_path TO public;
2 CREATE EXTENSION btree_gist;
3 CREATE EXTENSION btree_gin;
4 CREATE ROLE super_user
5   SUPERUSER
6   NOCREATEDB
7   NOCREATEROLE
8   NOINHERIT
9   NOLOGIN
10   NOREPLICATION
11   CONNECTION LIMIT 1;
12 CREATE ROLE normal_user
13   NOSUPERUSER
14   NOCREATEDB
15   NOCREATEROLE
16   NOINHERIT
17   NOLOGIN
18   NOREPLICATION
19   CONNECTION LIMIT 1;
20 CREATE SCHEMA s1;
21 CREATE SCHEMA s2;
22 CREATE TABLE s1.t1 (c1 int, c2 int, c3 int, c4 text, PRIMARY KEY (c1));
23 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
24 CREATE TABLE s1.t2 (LIKE s1.t1 INCLUDING ALL);
25 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t2_pkey" for table "t2"
26 CREATE TABLE s1.t3 (LIKE s1.t1 INCLUDING ALL);
27 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t3_pkey" for table "t3"
28 CREATE TABLE s1.t4 (LIKE s1.t1 INCLUDING ALL);
29 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t4_pkey" for table "t4"
30 CREATE TABLE s2.t1 (LIKE s1.t1 INCLUDING ALL);
31 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
32 CREATE TABLE s1.p1 (LIKE s1.t1 INCLUDING ALL);
33 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_pkey" for table "p1"
34 CREATE TABLE s1.p2 (LIKE s1.t1 INCLUDING ALL);
35 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2_pkey" for table "p2"
36 CREATE TABLE s1.p1c1 (LIKE s1.p1 INCLUDING ALL, CHECK (c1 <= 100)) INHERITS(s1.p1);
37 NOTICE:  merging column "c1" with inherited definition
38 NOTICE:  merging column "c2" with inherited definition
39 NOTICE:  merging column "c3" with inherited definition
40 NOTICE:  merging column "c4" with inherited definition
41 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1c1_pkey" for table "p1c1"
42 CREATE TABLE s1.p1c2 (LIKE s1.p1 INCLUDING ALL, CHECK (c1 > 100 AND c1 <= 200)) INHERITS(s1.p1);
43 NOTICE:  merging column "c1" with inherited definition
44 NOTICE:  merging column "c2" with inherited definition
45 NOTICE:  merging column "c3" with inherited definition
46 NOTICE:  merging column "c4" with inherited definition
47 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1c2_pkey" for table "p1c2"
48 CREATE TABLE s1.p1c3 (LIKE s1.p1 INCLUDING ALL, CHECK (c1 > 200)) INHERITS(s1.p1);
49 NOTICE:  merging column "c1" with inherited definition
50 NOTICE:  merging column "c2" with inherited definition
51 NOTICE:  merging column "c3" with inherited definition
52 NOTICE:  merging column "c4" with inherited definition
53 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1c3_pkey" for table "p1c3"
54 CREATE TABLE s1.p2c1 (LIKE s1.p2 INCLUDING ALL, CHECK (c1 <= 100)) INHERITS(s1.p2);
55 NOTICE:  merging column "c1" with inherited definition
56 NOTICE:  merging column "c2" with inherited definition
57 NOTICE:  merging column "c3" with inherited definition
58 NOTICE:  merging column "c4" with inherited definition
59 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c1_pkey" for table "p2c1"
60 CREATE TABLE s1.p2c2 (LIKE s1.p2 INCLUDING ALL, CHECK (c1 > 100 AND c1 <= 200)) INHERITS(s1.p2);
61 NOTICE:  merging column "c1" with inherited definition
62 NOTICE:  merging column "c2" with inherited definition
63 NOTICE:  merging column "c3" with inherited definition
64 NOTICE:  merging column "c4" with inherited definition
65 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c2_pkey" for table "p2c2"
66 CREATE TABLE s1.p2c3 (LIKE s1.p2 INCLUDING ALL, CHECK (c1 > 200)) INHERITS(s1.p2);
67 NOTICE:  merging column "c1" with inherited definition
68 NOTICE:  merging column "c2" with inherited definition
69 NOTICE:  merging column "c3" with inherited definition
70 NOTICE:  merging column "c4" with inherited definition
71 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c3_pkey" for table "p2c3"
72 CREATE TABLE s1.p2c1c1 (LIKE s1.p2c1 INCLUDING ALL, CHECK (c1 <= 50)) INHERITS(s1.p2c1);
73 NOTICE:  merging column "c1" with inherited definition
74 NOTICE:  merging column "c2" with inherited definition
75 NOTICE:  merging column "c3" with inherited definition
76 NOTICE:  merging column "c4" with inherited definition
77 NOTICE:  merging constraint "p2c1_c1_check" with inherited definition
78 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c1c1_pkey" for table "p2c1c1"
79 CREATE TABLE s1.p2c1c2 (LIKE s1.p2c1 INCLUDING ALL, CHECK (c1 > 50 AND c1 <= 100)) INHERITS(s1.p2c1);
80 NOTICE:  merging column "c1" with inherited definition
81 NOTICE:  merging column "c2" with inherited definition
82 NOTICE:  merging column "c3" with inherited definition
83 NOTICE:  merging column "c4" with inherited definition
84 NOTICE:  merging constraint "p2c1_c1_check" with inherited definition
85 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c1c2_pkey" for table "p2c1c2"
86 CREATE TABLE s1.p2c2c1 (LIKE s1.p2c2 INCLUDING ALL, CHECK (c1 > 100 AND c1 <= 150)) INHERITS(s1.p2c2);
87 NOTICE:  merging column "c1" with inherited definition
88 NOTICE:  merging column "c2" with inherited definition
89 NOTICE:  merging column "c3" with inherited definition
90 NOTICE:  merging column "c4" with inherited definition
91 NOTICE:  merging constraint "p2c2_c1_check" with inherited definition
92 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c2c1_pkey" for table "p2c2c1"
93 CREATE TABLE s1.p2c2c2 (LIKE s1.p2c2 INCLUDING ALL, CHECK (c1 > 150 AND c1 <= 200)) INHERITS(s1.p2c2);
94 NOTICE:  merging column "c1" with inherited definition
95 NOTICE:  merging column "c2" with inherited definition
96 NOTICE:  merging column "c3" with inherited definition
97 NOTICE:  merging column "c4" with inherited definition
98 NOTICE:  merging constraint "p2c2_c1_check" with inherited definition
99 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c2c2_pkey" for table "p2c2c2"
100 CREATE TABLE s1.p2c3c1 (LIKE s1.p2c3 INCLUDING ALL, CHECK (c1 > 200 AND c1 <= 250)) INHERITS(s1.p2c3);
101 NOTICE:  merging column "c1" with inherited definition
102 NOTICE:  merging column "c2" with inherited definition
103 NOTICE:  merging column "c3" with inherited definition
104 NOTICE:  merging column "c4" with inherited definition
105 NOTICE:  merging constraint "p2c3_c1_check" with inherited definition
106 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c3c1_pkey" for table "p2c3c1"
107 CREATE TABLE s1.p2c3c2 (LIKE s1.p2c3 INCLUDING ALL, CHECK (c1 > 250)) INHERITS(s1.p2c3);
108 NOTICE:  merging column "c1" with inherited definition
109 NOTICE:  merging column "c2" with inherited definition
110 NOTICE:  merging column "c3" with inherited definition
111 NOTICE:  merging column "c4" with inherited definition
112 NOTICE:  merging constraint "p2c3_c1_check" with inherited definition
113 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p2c3c2_pkey" for table "p2c3c2"
114 CREATE TABLE s1.r1 (LIKE s1.t1);
115 CREATE TABLE s1.r2 (LIKE s1.t1);
116 CREATE TABLE s1.r3 (LIKE s1.t1);
117 CREATE TABLE s1.r1_ (LIKE s1.t1);
118 CREATE TABLE s1.r2_ (LIKE s1.t1);
119 CREATE TABLE s1.r3_ (LIKE s1.t1);
120 CREATE TABLE s1.ti1 (c1 int, c2 int, c3 int, c4 text, PRIMARY KEY (c1), UNIQUE (c2));
121 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "ti1_pkey" for table "ti1"
122 NOTICE:  CREATE TABLE / UNIQUE will create implicit index "ti1_c2_key" for table "ti1"
123 CREATE UNLOGGED TABLE s1.ul1 (LIKE s1.t1 INCLUDING ALL);
124 NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "ul1_pkey" for table "ul1"
125 INSERT INTO s1.t1 SELECT i, i, i % 100, i FROM (SELECT generate_series(1, 1000) i) t;
126 INSERT INTO s1.t2 SELECT i, i, i % 10, i FROM (SELECT generate_series(1, 100) i) t;
127 INSERT INTO s2.t1 SELECT i, i, i % 10, i FROM (SELECT generate_series(1, 100) i) t;
128 INSERT INTO s1.p1c1 SELECT i, i, i % 10, i FROM (SELECT generate_series(1, 100) i) t;
129 INSERT INTO s1.p1c2 SELECT i, i, i % 10, i FROM (SELECT generate_series(101, 200) i) t;
130 INSERT INTO s1.p1c3 SELECT i, i, i % 10, i FROM (SELECT generate_series(201, 300) i) t;
131 INSERT INTO s1.p2c1c1 SELECT i, i, i % 10, i FROM (SELECT generate_series(1, 50) i) t;
132 INSERT INTO s1.p2c1c2 SELECT i, i, i % 10, i FROM (SELECT generate_series(51, 100) i) t;
133 INSERT INTO s1.p2c2c1 SELECT i, i, i % 10, i FROM (SELECT generate_series(101, 150) i) t;
134 INSERT INTO s1.p2c2c2 SELECT i, i, i % 10, i FROM (SELECT generate_series(151, 200) i) t;
135 INSERT INTO s1.p2c3c1 SELECT i, i, i % 10, i FROM (SELECT generate_series(201, 250) i) t;
136 INSERT INTO s1.p2c3c2 SELECT i, i, i % 10, i FROM (SELECT generate_series(251, 300) i) t;
137 INSERT INTO s1.ti1 SELECT i, i, i % 100, i FROM (SELECT generate_series(1, 1000) i) t;
138 CREATE INDEX t1_i ON s1.t1 (c3);
139 CREATE INDEX t1_i1 ON s1.t1 (c1);
140 CREATE INDEX t2_i1 ON s1.t2 (c1);
141 CREATE INDEX t3_i1 ON s1.t3 (c1);
142 CREATE INDEX t4_i1 ON s1.t4 (c1);
143 CREATE INDEX p1_i ON s1.p1 (c1);
144 CREATE INDEX p2_i ON s1.p2 (c1);
145 CREATE INDEX p1c1_i ON s1.p1c1 (c1);
146 CREATE INDEX p1c2_i ON s1.p1c2 (c1);
147 CREATE INDEX p1c3_i ON s1.p1c3 (c1);
148 CREATE INDEX p2c1_i ON s1.p2c1 (c1);
149 CREATE INDEX p2c2_i ON s1.p2c2 (c1);
150 CREATE INDEX p2c3_i ON s1.p2c3 (c1);
151 CREATE INDEX p2c1c1_i ON s1.p2c1c1 (c1);
152 CREATE INDEX p2c1c2_i ON s1.p2c1c2 (c1);
153 CREATE INDEX p2c2c1_i ON s1.p2c2c1 (c1);
154 CREATE INDEX p2c2c2_i ON s1.p2c2c2 (c1);
155 CREATE INDEX p2c3c1_i ON s1.p2c3c1 (c1);
156 CREATE INDEX p2c3c2_i ON s1.p2c3c2 (c1);
157 CREATE INDEX ti1_i1    ON s1.ti1 (c2);
158 CREATE INDEX ti1_i2    ON s1.ti1 (c2, c4);
159 CREATE INDEX ti1_i3    ON s1.ti1 (c2, c4, c4);
160 CREATE INDEX ti1_i4    ON s1.ti1 (c2, c4, c4, c4);
161 CREATE INDEX ti1_btree ON s1.ti1 USING btree (c1);
162 CREATE INDEX ti1_hash  ON s1.ti1 USING hash (c1);
163 CREATE INDEX ti1_gist  ON s1.ti1 USING gist (c1);
164 CREATE INDEX ti1_gin   ON s1.ti1 USING gin (c1);
165 CREATE INDEX ti1_expr  ON s1.ti1 ((c1 < 100));
166 CREATE INDEX ti1_pred  ON s1.ti1 (lower(c4));
167 CREATE UNIQUE INDEX ti1_uniq ON s1.ti1 (c1);
168 CREATE INDEX ti1_multi ON s1.ti1 (c1, c2, c3, c4);
169 CREATE INDEX ti1_ts    ON s1.ti1 USING gin(to_tsvector('english', c4));
170 CREATE VIEW s1.v1 AS SELECT v1t1.c1, v1t1.c2, v1t1.c3, v1t1.c4 FROM s1.t1 v1t1;
171 CREATE VIEW s1.v1_ AS SELECT v1t1_.c1, v1t1_.c2, v1t1_.c3, v1t1_.c4 FROM s1.t1 v1t1_;
172 CREATE VIEW s1.v2 AS SELECT v2t1.c1, v2t1.c2, v2t1.c3, v2t1.c4 FROM s1.t1 v2t1 JOIN s1.t2 v2t2 ON(v2t1.c1 = v2t2.c1);
173 CREATE VIEW s1.v3 AS SELECT v3t1.c1, v3t1.c2, v3t1.c3, v3t1.c4 FROM s1.t1 v3t1 JOIN s1.t2 v3t2 ON(v3t1.c1 = v3t2.c1) JOIN s1.t3 v3t3 ON(v3t1.c1 = v3t3.c1);
174 ANALYZE s1.t1;
175 ANALYZE s1.t2;
176 ANALYZE s2.t1;
177 ANALYZE s1.p1;
178 ANALYZE s1.p2;
179 ANALYZE s1.p1c1;
180 ANALYZE s1.p1c2;
181 ANALYZE s1.p1c3;
182 ANALYZE s1.p2c1c1;
183 ANALYZE s1.p2c1c2;
184 ANALYZE s1.p2c2c1;
185 ANALYZE s1.p2c2c2;
186 ANALYZE s1.p2c3c1;
187 ANALYZE s1.p2c3c2;
188 ANALYZE s1.ti1;
189 CREATE FUNCTION s1.f1 () RETURNS s1.t1 AS $$
190 VALUES(1,1,1,'1'), (2,2,2,'2'), (3,3,3,'3')
191 $$ LANGUAGE sql;
192 CREATE RULE r1 AS ON UPDATE TO s1.r1 DO INSTEAD (
193 SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
194 );
195 CREATE RULE r2 AS ON UPDATE TO s1.r2 DO INSTEAD (
196 SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
197 SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
198 );
199 CREATE RULE r3 AS ON UPDATE TO s1.r3 DO INSTEAD (
200 SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
201 SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
202 SELECT max(t1.c1) FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.ctid = '(1,1)' AND t1.c1 = t2.c1 AND t2.ctid = '(1,1)' AND t1.c1 = t3.c1 AND t3.ctid = '(1,1)' AND t1.c1 = t4.c1 AND t4.ctid = '(1,1)';
203 );
204 CREATE RULE r1_ AS ON UPDATE TO s1.r1_ DO INSTEAD (
205 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)';
206 );
207 CREATE RULE r2_ AS ON UPDATE TO s1.r2_ DO INSTEAD (
208 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)';
209 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)';
210 );
211 CREATE RULE r3_ AS ON UPDATE TO s1.r3_ DO INSTEAD (
212 SELECT max(b1t1.c1) FROM s1.t1 b1t1, s1.t2 b1t2, s1.t3 b1t3, s1.t4 b1t4 WHERE b1t1.ctid = '(1,1)' AND b1t1.c1 = b1t2.c1 AND b1t2.ctid = '(1,1)' AND b1t1.c1 = b1t3.c1 AND b1t3.ctid = '(1,1)' AND b1t1.c1 = b1t4.c1 AND b1t4.ctid = '(1,1)';
213 SELECT max(b2t1.c1) FROM s1.t1 b2t1, s1.t2 b2t2, s1.t3 b2t3, s1.t4 b2t4 WHERE b2t1.ctid = '(1,1)' AND b2t1.c1 = b2t2.c1 AND b2t2.ctid = '(1,1)' AND b2t1.c1 = b2t3.c1 AND b2t3.ctid = '(1,1)' AND b2t1.c1 = b2t4.c1 AND b2t4.ctid = '(1,1)';
214 SELECT max(b3t1.c1) FROM s1.t1 b3t1, s1.t2 b3t2, s1.t3 b3t3, s1.t4 b3t4 WHERE b3t1.ctid = '(1,1)' AND b3t1.c1 = b3t2.c1 AND b3t2.ctid = '(1,1)' AND b3t1.c1 = b3t3.c1 AND b3t3.ctid = '(1,1)' AND b3t1.c1 = b3t4.c1 AND b3t4.ctid = '(1,1)';
215 );