inh.sql

application/octet-stream

Filename: inh.sql
Type: application/octet-stream
Part: 0
Message: MergeAppend costing
CREATE TABLE ma_parent (
	id					integer not null,
	name				varchar not null,
	cost				integer not null,
	PRIMARY KEY (id)
);

CREATE TABLE ma_child1 (
	PRIMARY KEY (id)
) INHERITS (ma_parent);

CREATE INDEX ma_child1_name ON ma_child1 (name);

INSERT INTO ma_child1
	SELECT
		g,
		random()::text || random()::text || random()::text || random()::text,
		random() * 1000
	FROM
		generate_series(1, 1000000) g;

CLUSTER ma_child1 USING ma_child1_name;

CREATE TABLE ma_child2 (
	PRIMARY KEY (id)
) INHERITS (ma_parent);

INSERT INTO ma_child2
	SELECT
		g,
		random()::text || random()::text || random()::text || random()::text,
		random() * 1000
	FROM
		generate_series(1, 1000000) g;

CLUSTER ma_child2 USING ma_child2_pkey;

ANALYZE;