SET search_path TO public;
CREATE SCHEMA s0;
CREATE TABLE t1 (id int PRIMARY KEY, val int);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
CREATE TABLE t2 (id int PRIMARY KEY, val int);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t2_pkey" for table "t2"
CREATE TABLE t3 (id int PRIMARY KEY, val int);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t3_pkey" for table "t3"
CREATE TABLE t4 (id int PRIMARY KEY, val int);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t4_pkey" for table "t4"
CREATE TABLE p1 (id int PRIMARY KEY, val int);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_pkey" for table "p1"
CREATE TABLE p1_c1 (LIKE p1 INCLUDING ALL, CHECK (id <= 100)) INHERITS(p1);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_pkey" for table "p1_c1"
CREATE TABLE p1_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 100 AND id <= 200)) INHERITS(p1);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c2_pkey" for table "p1_c2"
CREATE TABLE p1_c3 (LIKE p1 INCLUDING ALL, CHECK (id > 200 AND id <= 300)) INHERITS(p1);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_pkey" for table "p1_c3"
CREATE TABLE p1_c4 (LIKE p1 INCLUDING ALL, CHECK (id > 300)) INHERITS(p1);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c4_pkey" for table "p1_c4"
CREATE TABLE p1_c1_c1 (LIKE p1 INCLUDING ALL, CHECK (id <= 50)) INHERITS(p1_c1);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_c1_pkey" for table "p1_c1_c1"
CREATE TABLE p1_c1_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 50 AND id <= 100)) INHERITS(p1_c1);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c1_c2_pkey" for table "p1_c1_c2"
CREATE TABLE p1_c3_c1 (LIKE p1 INCLUDING ALL, CHECK (id > 200 AND id <= 250)) INHERITS(p1_c3);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_c1_pkey" for table "p1_c3_c1"
CREATE TABLE p1_c3_c2 (LIKE p1 INCLUDING ALL, CHECK (id > 250 AND id <= 300)) INHERITS(p1_c3);
NOTICE:  merging column "id" with inherited definition
NOTICE:  merging column "val" with inherited definition
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "p1_c3_c2_pkey" for table "p1_c3_c2"
CREATE TABLE s0.t1 (id int PRIMARY KEY, val int);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
INSERT INTO t1 SELECT i, i % 100 FROM (SELECT generate_series(1, 10000) i) t;
INSERT INTO t2 SELECT i, i % 10 FROM (SELECT generate_series(1, 1000) i) t;
INSERT INTO t3 SELECT i, i FROM (SELECT generate_series(1, 100) i) t;
INSERT INTO t4 SELECT i, i FROM (SELECT generate_series(1, 10) i) t;
INSERT INTO p1_c1_c1 SELECT i, i % 100 FROM (SELECT generate_series(1, 50) i) t;
INSERT INTO p1_c1_c2 SELECT i, i % 100 FROM (SELECT generate_series(51, 100) i) t;
INSERT INTO p1_c2 SELECT i, i % 100 FROM (SELECT generate_series(101, 200) i) t;
INSERT INTO p1_c3_c1 SELECT i, i % 100 FROM (SELECT generate_series(201, 250) i) t;
INSERT INTO p1_c3_c2 SELECT i, i % 100 FROM (SELECT generate_series(251, 300) i) t;
INSERT INTO p1_c4 SELECT i, i % 100 FROM (SELECT generate_series(301, 400) i) t;
CREATE INDEX t1_val ON t1 (val);
CREATE INDEX t2_val ON t2 (val);
ANALYZE t1;
ANALYZE t2;
ANALYZE t3;
ANALYZE t4;
ANALYZE p1;
ANALYZE p1_c1;
ANALYZE p1_c2;
CREATE VIEW v1 AS SELECT id, val FROM t1;
CREATE VIEW v2 AS SELECT t1.id t1_id, t1.val t1_val, t2.id t2_id, t2.val t2_val FROM t1, t2 WHERE t1.id = t2.id;
CREATE VIEW v3 AS SELECT t_1.id t1_id, t_1.val t1_val, t_2.id t2_id, t_2.val t2_val FROM t1 t_1, t2 t_2 WHERE t_1.id = t_2.id;
CREATE VIEW v4 AS SELECT v_2.t1_id, t_3.id FROM v2 v_2, t3 t_3 WHERE v_2.t1_id = t_3.id;
/*
 * The following GUC parameters need the setting of the default value to
 * succeed in regression test.
 */
CREATE VIEW settings AS
SELECT name, setting, category
  FROM pg_settings
 WHERE category LIKE 'Query Tuning%'
    OR name = 'client_min_messages'
 ORDER BY category, name;
SELECT * FROM settings;
           name            |  setting  |                  category                   
---------------------------+-----------+---------------------------------------------
 geqo                      | on        | Query Tuning / Genetic Query Optimizer
 geqo_effort               | 5         | Query Tuning / Genetic Query Optimizer
 geqo_generations          | 0         | Query Tuning / Genetic Query Optimizer
 geqo_pool_size            | 0         | Query Tuning / Genetic Query Optimizer
 geqo_seed                 | 0         | Query Tuning / Genetic Query Optimizer
 geqo_selection_bias       | 2         | Query Tuning / Genetic Query Optimizer
 geqo_threshold            | 12        | Query Tuning / Genetic Query Optimizer
 constraint_exclusion      | partition | Query Tuning / Other Planner Options
 cursor_tuple_fraction     | 0.1       | Query Tuning / Other Planner Options
 default_statistics_target | 100       | Query Tuning / Other Planner Options
 from_collapse_limit       | 8         | Query Tuning / Other Planner Options
 join_collapse_limit       | 8         | Query Tuning / Other Planner Options
 cpu_index_tuple_cost      | 0.005     | Query Tuning / Planner Cost Constants
 cpu_operator_cost         | 0.0025    | Query Tuning / Planner Cost Constants
 cpu_tuple_cost            | 0.01      | Query Tuning / Planner Cost Constants
 effective_cache_size      | 16384     | Query Tuning / Planner Cost Constants
 random_page_cost          | 4         | Query Tuning / Planner Cost Constants
 seq_page_cost             | 1         | Query Tuning / Planner Cost Constants
 enable_bitmapscan         | on        | Query Tuning / Planner Method Configuration
 enable_hashagg            | on        | Query Tuning / Planner Method Configuration
 enable_hashjoin           | on        | Query Tuning / Planner Method Configuration
 enable_indexscan          | on        | Query Tuning / Planner Method Configuration
 enable_material           | on        | Query Tuning / Planner Method Configuration
 enable_mergejoin          | on        | Query Tuning / Planner Method Configuration
 enable_nestloop           | on        | Query Tuning / Planner Method Configuration
 enable_seqscan            | on        | Query Tuning / Planner Method Configuration
 enable_sort               | on        | Query Tuning / Planner Method Configuration
 enable_tidscan            | on        | Query Tuning / Planner Method Configuration
 client_min_messages       | notice    | Reporting and Logging / When to Log
(29 rows)

