|
|
|
@ -22,14 +22,30 @@ CREATE OR REPLACE FUNCTION relation_ddl_access_mode(relationId Oid)
|
|
|
|
|
RETURNS int
|
|
|
|
|
LANGUAGE C STABLE STRICT
|
|
|
|
|
AS 'citus', $$relation_ddl_access_mode$$;
|
|
|
|
|
CREATE OR REPLACE FUNCTION relation_access_mode_to_text(relationShardAccess int)
|
|
|
|
|
CREATE OR REPLACE FUNCTION distributed_relation(relation_name text)
|
|
|
|
|
RETURNS bool AS
|
|
|
|
|
$$
|
|
|
|
|
DECLARE
|
|
|
|
|
part_method char;
|
|
|
|
|
BEGIN
|
|
|
|
|
select partmethod INTO part_method from pg_dist_partition WHERE logicalrelid = relation_name::regclass;
|
|
|
|
|
IF part_method = 'h' THEN
|
|
|
|
|
RETURN true;
|
|
|
|
|
ELSE
|
|
|
|
|
RETURN false;
|
|
|
|
|
END IF;
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' IMMUTABLE;
|
|
|
|
|
CREATE OR REPLACE FUNCTION relation_access_mode_to_text(relation_name text, relationShardAccess int)
|
|
|
|
|
RETURNS text AS
|
|
|
|
|
$$
|
|
|
|
|
BEGIN
|
|
|
|
|
IF relationShardAccess = 0 THEN
|
|
|
|
|
IF relationShardAccess = 0 and distributed_relation(relation_name) THEN
|
|
|
|
|
RETURN 'not_parallel_accessed';
|
|
|
|
|
ELSIF relationShardAccess = 0 and NOT distributed_relation(relation_name) THEN
|
|
|
|
|
RETURN 'not_accessed';
|
|
|
|
|
ELSIF relationShardAccess = 1 THEN
|
|
|
|
|
RETURN 'sequential_access';
|
|
|
|
|
RETURN 'reference_table_access';
|
|
|
|
|
ELSE
|
|
|
|
|
RETURN 'parallel_access';
|
|
|
|
|
END IF;
|
|
|
|
@ -37,9 +53,9 @@ END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' IMMUTABLE;
|
|
|
|
|
CREATE VIEW relation_acesses AS
|
|
|
|
|
SELECT table_name,
|
|
|
|
|
relation_access_mode_to_text(relation_select_access_mode(table_name::regclass)) as select_access,
|
|
|
|
|
relation_access_mode_to_text(relation_dml_access_mode(table_name::regclass)) as dml_access,
|
|
|
|
|
relation_access_mode_to_text(relation_ddl_access_mode(table_name::regclass)) as ddl_access
|
|
|
|
|
relation_access_mode_to_text(table_name, relation_select_access_mode(table_name::regclass)) as select_access,
|
|
|
|
|
relation_access_mode_to_text(table_name, relation_dml_access_mode(table_name::regclass)) as dml_access,
|
|
|
|
|
relation_access_mode_to_text(table_name, relation_ddl_access_mode(table_name::regclass)) as ddl_access
|
|
|
|
|
FROM
|
|
|
|
|
((SELECT 'table_' || i as table_name FROM generate_series(1, 7) i) UNION (SELECT 'partitioning_test') UNION (SELECT 'partitioning_test_2009') UNION (SELECT 'partitioning_test_2010')) tables;
|
|
|
|
|
SET citus.shard_replication_factor TO 1;
|
|
|
|
@ -102,8 +118,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_7') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-----------------
|
|
|
|
|
table_7 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
table_7 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -116,8 +132,8 @@ SELECT count(*) FROM table_1;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+--------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
-- a very simple test that first checks sequential
|
|
|
|
@ -125,8 +141,8 @@ SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
BEGIN;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+--------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT count(*) FROM table_1 WHERE key = 1;
|
|
|
|
@ -137,8 +153,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+--------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT count(*) FROM table_1 WHERE key = 1 OR key = 2;
|
|
|
|
@ -149,30 +165,30 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+--------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
INSERT INTO table_1 VALUES (1,1);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-------------------+--------------
|
|
|
|
|
table_1 | parallel_access | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
INSERT INTO table_1 VALUES (1,1), (2,2);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-------------------+--------------
|
|
|
|
|
table_1 | parallel_access | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ALTER TABLE table_1 ADD COLUMN test_col INT;
|
|
|
|
|
-- now see that the other tables are not accessed at all
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-------------------+-----------------
|
|
|
|
|
table_1 | parallel_access | sequential_access | parallel_access
|
|
|
|
|
------------+-----------------+-----------------------+-----------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | parallel_access
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -187,8 +203,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+--------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT count(*) FROM table_1 WHERE key = 2;
|
|
|
|
@ -199,22 +215,22 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+--------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
INSERT INTO table_1 VALUES (1,1);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+-------------------+--------------
|
|
|
|
|
table_1 | sequential_access | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
INSERT INTO table_1 VALUES (2,2);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+-------------------+--------------
|
|
|
|
|
table_1 | sequential_access | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -223,8 +239,8 @@ BEGIN;
|
|
|
|
|
ALTER TABLE table_1 ADD CONSTRAINT table_1_u UNIQUE (key);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-----------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -245,14 +261,14 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name LIKE 'table_%' ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+--------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_3 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_4 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_5 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_3 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_4 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_5 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_6 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
table_7 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
table_7 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(7 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -271,9 +287,9 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+--------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -294,9 +310,9 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+--------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -321,14 +337,14 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name LIKE 'table_%' ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+--------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_3 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_4 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_5 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_3 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_4 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_5 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_6 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
table_7 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
table_7 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(7 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -339,17 +355,17 @@ BEGIN;
|
|
|
|
|
UPDATE table_1 SET value = 15;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name = 'table_1';
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
------------+-----------------+-----------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SET LOCAL citus.multi_shard_modify_mode = 'sequential';
|
|
|
|
|
UPDATE table_2 SET value = 15;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+-------------------+--------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
table_2 | sequential_access | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -360,10 +376,10 @@ BEGIN;
|
|
|
|
|
WHERE key IN (SELECT key FROM table_2 JOIN table_3 USING (key) WHERE table_2.value = 15);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2', 'table_3') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
table_2 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_3 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
table_2 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_3 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -372,9 +388,9 @@ BEGIN;
|
|
|
|
|
INSERT INTO table_2 SELECT * FROM table_1;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | not_accessed | parallel_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | parallel_access | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -384,9 +400,9 @@ BEGIN;
|
|
|
|
|
INSERT INTO table_2 SELECT * FROM table_1;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+-------------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | not_accessed | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -395,9 +411,9 @@ BEGIN;
|
|
|
|
|
INSERT INTO table_2 SELECT * FROM table_1 OFFSET 0;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | not_accessed | parallel_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | parallel_access | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -423,9 +439,9 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+--------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -446,10 +462,10 @@ BEGIN;
|
|
|
|
|
) as foo;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2', 'table_3') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_3 | not_accessed | parallel_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_3 | not_parallel_accessed | parallel_access | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -472,10 +488,10 @@ BEGIN;
|
|
|
|
|
) as foo;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2', 'table_3') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+-------------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
table_3 | not_accessed | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_3 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -498,11 +514,11 @@ BEGIN;
|
|
|
|
|
) AND value IN (SELECT key FROM table_4);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2', 'table_3', 'table_4') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_2 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
table_3 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
table_4 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_3 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
table_4 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(4 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -514,8 +530,8 @@ BEGIN;
|
|
|
|
|
3 3
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+--------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -524,8 +540,8 @@ BEGIN;
|
|
|
|
|
COPY table_1 FROM STDIN WITH CSV;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+-----------------+--------------
|
|
|
|
|
table_1 | not_accessed | parallel_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | parallel_access | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -534,8 +550,8 @@ BEGIN;
|
|
|
|
|
COPY table_1 FROM STDIN WITH CSV;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+-------------------+--------------
|
|
|
|
|
table_1 | not_accessed | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -549,22 +565,22 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_6');
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+--------------+--------------
|
|
|
|
|
table_6 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------+------------------------+--------------+--------------
|
|
|
|
|
table_6 | reference_table_access | not_accessed | not_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
UPDATE table_6 SET value = 15;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_6');
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+-------------------+--------------
|
|
|
|
|
table_6 | sequential_access | sequential_access | not_accessed
|
|
|
|
|
------------+------------------------+------------------------+--------------
|
|
|
|
|
table_6 | reference_table_access | reference_table_access | not_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ALTER TABLE table_6 ADD COLUMN x INT;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_6');
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+-------------------+-------------------
|
|
|
|
|
table_6 | sequential_access | sequential_access | sequential_access
|
|
|
|
|
------------+------------------------+------------------------+------------------------
|
|
|
|
|
table_6 | reference_table_access | reference_table_access | reference_table_access
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -578,8 +594,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_6', 'table_1') ORDER BY 1,2;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+--------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_6 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
@ -589,8 +605,8 @@ BEGIN;
|
|
|
|
|
TRUNCATE table_1;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-----------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -600,8 +616,8 @@ BEGIN;
|
|
|
|
|
TRUNCATE table_1;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-------------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | sequential_access
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -610,8 +626,8 @@ BEGIN;
|
|
|
|
|
TRUNCATE table_6;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_6') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-------------------
|
|
|
|
|
table_6 | not_accessed | not_accessed | sequential_access
|
|
|
|
|
------------+---------------+--------------+------------------------
|
|
|
|
|
table_6 | not_accessed | not_accessed | reference_table_access
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -621,9 +637,9 @@ BEGIN;
|
|
|
|
|
ALTER TABLE table_2 ADD CONSTRAINT table_2_u FOREIGN KEY (key) REFERENCES table_1(key);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-----------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
table_2 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -634,9 +650,9 @@ BEGIN;
|
|
|
|
|
ALTER TABLE table_2 ADD CONSTRAINT table_2_u FOREIGN KEY (key) REFERENCES table_1(key);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-------------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | sequential_access
|
|
|
|
|
table_2 | not_accessed | not_accessed | sequential_access
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -652,9 +668,9 @@ BEGIN;
|
|
|
|
|
CREATE TABLE partitioning_test_2009 PARTITION OF partitioning_test FOR VALUES FROM ('2009-01-01') TO ('2010-01-01');
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+---------------+--------------+-----------------
|
|
|
|
|
partitioning_test | not_accessed | not_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -664,9 +680,9 @@ BEGIN;
|
|
|
|
|
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2009 FOR VALUES FROM ('2009-01-01') TO ('2010-01-01');
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+---------------+--------------+-----------------
|
|
|
|
|
partitioning_test | not_accessed | not_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -682,9 +698,9 @@ BEGIN;
|
|
|
|
|
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2010 FOR VALUES FROM ('2010-01-01') TO ('2011-01-01');
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+---------------+--------------+-----------------
|
|
|
|
|
partitioning_test | not_accessed | not_accessed | parallel_access
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -698,10 +714,10 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-----------------+--------------+--------------
|
|
|
|
|
partitioning_test | parallel_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2010 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -716,10 +732,10 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-------------------+--------------+--------------
|
|
|
|
|
partitioning_test | sequential_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2009 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2010 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -728,10 +744,10 @@ BEGIN;
|
|
|
|
|
UPDATE partitioning_test SET time = now();
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-----------------+-----------------+--------------
|
|
|
|
|
partitioning_test | parallel_access | parallel_access | not_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
partitioning_test_2010 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
------------------------+-----------------+-----------------+-----------------------
|
|
|
|
|
partitioning_test | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -741,10 +757,10 @@ BEGIN;
|
|
|
|
|
UPDATE partitioning_test SET time = now();
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-------------------+-------------------+--------------
|
|
|
|
|
partitioning_test | sequential_access | sequential_access | not_accessed
|
|
|
|
|
partitioning_test_2009 | sequential_access | sequential_access | not_accessed
|
|
|
|
|
partitioning_test_2010 | sequential_access | sequential_access | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -753,10 +769,10 @@ BEGIN;
|
|
|
|
|
ALTER TABLE partitioning_test ADD COLUMN X INT;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+---------------+--------------+-----------------
|
|
|
|
|
partitioning_test | not_accessed | not_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -766,10 +782,10 @@ BEGIN;
|
|
|
|
|
ALTER TABLE partitioning_test ADD COLUMN X INT;
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+---------------+--------------+-------------------
|
|
|
|
|
partitioning_test | not_accessed | not_accessed | sequential_access
|
|
|
|
|
partitioning_test_2009 | not_accessed | not_accessed | sequential_access
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | sequential_access
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -783,10 +799,10 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-----------------+--------------+--------------
|
|
|
|
|
partitioning_test | parallel_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -801,10 +817,10 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-------------------+--------------+--------------
|
|
|
|
|
partitioning_test | sequential_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2009 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -813,10 +829,10 @@ BEGIN;
|
|
|
|
|
UPDATE partitioning_test_2009 SET time = now();
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-----------------+-----------------+--------------
|
|
|
|
|
partitioning_test | parallel_access | parallel_access | not_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -826,10 +842,10 @@ BEGIN;
|
|
|
|
|
UPDATE partitioning_test_2009 SET time = now();
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+-------------------+-------------------+--------------
|
|
|
|
|
partitioning_test | sequential_access | sequential_access | not_accessed
|
|
|
|
|
partitioning_test_2009 | sequential_access | sequential_access | not_accessed
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -838,10 +854,10 @@ BEGIN;
|
|
|
|
|
CREATE INDEX i1000000 ON partitioning_test_2009 (id);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+---------------+--------------+-----------------
|
|
|
|
|
partitioning_test | not_accessed | not_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -851,10 +867,10 @@ BEGIN;
|
|
|
|
|
CREATE INDEX i1000000 ON partitioning_test_2009 (id);
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('partitioning_test', 'partitioning_test_2009', 'partitioning_test_2010') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------------------+---------------+--------------+-------------------
|
|
|
|
|
partitioning_test | not_accessed | not_accessed | sequential_access
|
|
|
|
|
partitioning_test_2009 | not_accessed | not_accessed | sequential_access
|
|
|
|
|
partitioning_test_2010 | not_accessed | not_accessed | not_accessed
|
|
|
|
|
------------------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
partitioning_test | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2009 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
partitioning_test_2010 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -865,9 +881,9 @@ BEGIN;
|
|
|
|
|
NOTICE: truncate cascades to table "table_2"
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1', 'table_2') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+--------------+-----------------
|
|
|
|
|
table_1 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
table_2 | not_accessed | not_accessed | parallel_access
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
table_2 | not_parallel_accessed | not_parallel_accessed | parallel_access
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -883,8 +899,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+--------------+--------------
|
|
|
|
|
table_1 | parallel_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -900,8 +916,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-------------------+--------------+--------------
|
|
|
|
|
table_1 | sequential_access | not_accessed | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
@ -919,8 +935,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+-------------------+--------------
|
|
|
|
|
table_1 | not_accessed | sequential_access | not_accessed
|
|
|
|
|
------------+-----------------------+-----------------------+-----------------------
|
|
|
|
|
table_1 | not_parallel_accessed | not_parallel_accessed | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -936,8 +952,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
------------+-----------------+-----------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -953,8 +969,8 @@ BEGIN;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_1') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+-----------------+-----------------+--------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_accessed
|
|
|
|
|
------------+-----------------+-----------------+-----------------------
|
|
|
|
|
table_1 | parallel_access | parallel_access | not_parallel_accessed
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
ROLLBACK;
|
|
|
|
@ -973,18 +989,19 @@ NOTICE: Copying data from local table...
|
|
|
|
|
|
|
|
|
|
SELECT * FROM relation_acesses WHERE table_name IN ('table_3') ORDER BY 1;
|
|
|
|
|
table_name | select_access | dml_access | ddl_access
|
|
|
|
|
------------+---------------+-----------------+-----------------
|
|
|
|
|
table_3 | not_accessed | parallel_access | parallel_access
|
|
|
|
|
------------+-----------------------+-----------------+-----------------
|
|
|
|
|
table_3 | not_parallel_accessed | parallel_access | parallel_access
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
SET search_path TO 'public';
|
|
|
|
|
DROP SCHEMA access_tracking CASCADE;
|
|
|
|
|
NOTICE: drop cascades to 13 other objects
|
|
|
|
|
NOTICE: drop cascades to 14 other objects
|
|
|
|
|
DETAIL: drop cascades to function access_tracking.relation_select_access_mode(oid)
|
|
|
|
|
drop cascades to function access_tracking.relation_dml_access_mode(oid)
|
|
|
|
|
drop cascades to function access_tracking.relation_ddl_access_mode(oid)
|
|
|
|
|
drop cascades to function access_tracking.relation_access_mode_to_text(integer)
|
|
|
|
|
drop cascades to function access_tracking.distributed_relation(text)
|
|
|
|
|
drop cascades to function access_tracking.relation_access_mode_to_text(text,integer)
|
|
|
|
|
drop cascades to view access_tracking.relation_acesses
|
|
|
|
|
drop cascades to table access_tracking.table_1
|
|
|
|
|
drop cascades to table access_tracking.table_2
|
|
|
|
|