parallel index creation: maintenance_work_mem not honored?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,


I noticed that after an upgrade from 9.6 to 14.x, Postgres started producing temp files.

I narrowed down the behavior to parallel operations.



I was able to reproduce the following on a test machine running latest Postgres 14.4 on Ubuntu 18.04


CREATE TABLE test_parallel (i int);
INSERT INTO test_parallel VALUES (generate_series(0,10000000));


table size: 346 MB
maintenance_work_mem = '5GB' (but the same would happen if we set much higher values)


CREATE INDEX test_parallel_i_idx ON test_parallel (i);

... LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp4611.1.sharedfileset/2.0", size 37879808
... STATEMENT:  CREATE INDEX test_parallel_i_idx ON test_parallel (i);
... LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp4611.1.sharedfileset/0.0", size 59326464
... STATEMENT:  CREATE INDEX test_parallel_i_idx ON test_parallel (i);
... LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp4611.1.sharedfileset/1.0", size 103194624
... STATEMENT:  CREATE INDEX test_parallel_i_idx ON test_parallel (i);



After disabling parallelism with:

ALTER TABLE test_parallel SET (parallel_workers = 0);


The same 'CREATE INDEX' statement does not produce temp files.




Is this behavior expected? I cannot find mentions on the documentation nor on the literature available to me.



regards,

fabio pardi



[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux