Suppose I were to run the following. The first line shows the server's default maintenance_work_mem value.

mhildreth=# show maintenance_work_mem;
(1 row)

mhildreth=# set maintenance_work_mem = '256MB';

mhildreth=# CREATE INDEX CONCURRENTLY ON my_table(columns);

mhildreth=# set maintenance_work_mem = DEFAULT;

What would be used for maintenance_work_mem of the index creation?

1 Answer 1


In your example, the maintenance_work_mem you have set of 256MB should be seen by the subsequent CREATE INDEX CONCURRENTLY command, because you have changed this GUC inside your session.

In fact, the docs suggest bumping up maintenance_work_mem (as you showed) for just such a purpose.

  • Thanks. I think I was under the mistaken impression that CREATE INDEX CONCURRENTLY would actually kick off some background job to do the index creation, and was worried that the background job wouldn't have the changes to the GUC. Since this assumption is false, it does make sense that the new config would hold. May 25, 2016 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.