citus
citus copied to clipboard
EXPLAIN ANALYZE executes subplans twice
We execute the subplans normally, and again as part of EXPLAIN ANALYZE:
CREATE TABLE test (x int primary key, y int);
SELECT create_distributed_table('test','x');
EXPLAIN ANALYZE WITH a AS (INSERT INTO test VALUES (1,2) RETURNING *) SELECT * FROM a;
ERROR: duplicate key value violates unique constraint "test_pkey_102042"
DETAIL: Key (x)=(1) already exists.
A customer ran into the other side-effect of this issue: EXPLAIN ANALYZE execution times in subplans still use cached times.