citus icon indicating copy to clipboard operation
citus copied to clipboard

INSERT INTO ... SELECT fails when auto_explain is configured with auto_explain.log_analyze = true.

Open emelsimsek opened this issue 3 years ago • 1 comments

Regression runs surfaced that with the following auto_explain configuration, INSERT INTO ... SELECT commands fail.

shared_preload_libraries = 'citus,pg_stat_statements,auto_explain' auto_explain.log_min_duration = 0 // Setting this to 0 logs all plans.-1 (the default) disables logging of plans auto_explain.log_analyze = true

Repro steps:

  1. Configure auto_explain with analyze option tuned on.

  2. Run an INSERT INTO ... SELECT query. E.g:

    CREATE TABLE source_table(a int); SELECT create_distributed_table('source_table', 'a'); INSERT INTO source_table SELECT * FROM generate_series(1, 10);

Expected: source_table should have 10 rows. Observed :

INSERT INTO source_table SELECT * FROM generate_series(1, 10); ERROR: EXPLAIN ANALYZE is currently not supported for INSERT ... SELECT commands via coordinator select count(*) from source_table; count ------- 0 (1 row)

This query should still work even though the explain analyze fails silently.

emelsimsek avatar Oct 14 '22 12:10 emelsimsek

Okay, I think we can skip implementing this for now, because it seems like a new feature development (e.g., support EXPLAIN ANALYZE for INSERT .. SELECT via coordinator)

onderkalaci avatar Oct 17 '22 07:10 onderkalaci