citus icon indicating copy to clipboard operation
citus copied to clipboard

EXPLAIN ANALYZE executes subplans twice

Open marcocitus opened this issue 5 years ago • 1 comments

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.

marcocitus avatar Oct 01 '20 09:10 marcocitus

A customer ran into the other side-effect of this issue: EXPLAIN ANALYZE execution times in subplans still use cached times.

marcocitus avatar Oct 07 '21 11:10 marcocitus