Нет, из postgresql.conf взял выдержку.
Насчёт EXPLAIN
вот что сейчас есть
Insert on public.table (cost=0.00..10.00 rows=500 width=1350) (actual time=1368.299..1368.300 rows=0 loops=1)
Buffers: shared hit=5962 read=229 dirtied=396 written=85
-> Values Scan on "*VALUES*" (cost=0.00..10.00 rows=500 width=1350) (actual time=0.030..3.947 rows=500 loops=1)
Output: "*VALUES*".column1, "*VALUES*".column2, "*VALUES*".column3, "*VALUES*".column4, "*VALUES*".column5, "*VALUES*".column6, "*VALUES*".column7, timezone('utc'::text, now()), "*VALUES*".column8, "*VALUES*".column9, "*VALUES*".column10, "*VALUES*".column11, nextval('table_id_seq'::regclass), "*VALUES*".column12
Buffers: shared hit=500 dirtied=1
Settings: effective_cache_size = '6GB', effective_io_concurrency = '2', max_parallel_workers = '6', max_parallel_workers_per_gather = '3', work_mem = '7061kB'
Planning Time: 5.663 ms
Execution Time: 1368.360 ms
(8 rows)
Time: 1409.785 ms (00:01.410)
> Нет, из postgresql.conf взял выдержку.
Так проверьте эти параметры (те, которых в explain запроса нет, самый важный — shared_buffers) с помощью pg_settings или SHOW (мало ли).
> Buffers: shared hit=5962 read=229 dirtied=396 written=85
И это после нескольких таких INSERT (не на "холодной" базе)?