Re: parallel index creation: maintenance_work_mem not honored?

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Fabio Pardi <f(dot)pardi(at)portavita(dot)eu>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: parallel index creation: maintenance_work_mem not honored?
Date: 2022-06-21 05:46:52
Message-ID: CAH2-Wz=M8oic5i8++jp+_94qes51sv8BgmmsW9uRANw+1oP_eg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Jun 20, 2022 at 10:38 PM Fabio Pardi <f(dot)pardi(at)portavita(dot)eu> wrote:
> Just to make sure we are on the same page: every parallel 'CREATE INDEX' writes to temp files, ok.

Yes.

> But why the temp files are always on disk and not in RAM as other operations do?

Why not?

It is probably true that it would be better to use shared memory in
the case where there is sufficient memory, but it's not all that
significant compared to everything else that must happen at the same
time. It's rarely the bottleneck. External sorts are often faster than
internal sorts. That happens because they can be more CPU cache
friendly, for reasons that aren't fundamental.

> In the case where there is amble maintenance_work_mem, all writes to
> and reads from temp files will be sequential.

Yes.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message James Pang (chaolpan) 2022-06-21 10:18:20 multiple sessions to create index in parallel support
Previous Message Fabio Pardi 2022-06-21 05:38:17 Re: parallel index creation: maintenance_work_mem not honored?