Partitions and work_mem?

From: Dave Johansen <davejohansen(at)gmail(dot)com>
To: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Partitions and work_mem?
Date: 2014-10-14 17:08:26
Message-ID: CAAcYxUd--XzHPRsr3wz++x8HLzFUGLYyWUt4vy6+zTup+cviLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I'm running Postgres 8.4 on RHEL 6 64-bit and I had a question about how
work_mem and partitions interact.

https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server#work_mem
The above wiki states that "if a query involves doing merge sorts of 8
tables, that requires 8 times work_mem." If I have a table that is
partitioned does each partition count as a "table" and get its on work_mem?

For example, say I have the following table partitioned by the time column:
CREATE TABLE values (time TIMESTAMP, value INTEGER);
If I do the following query will it require 1 work_mem or N work_mem's
(where N is the number of partitions)?
SELECT * FROM values ORDER BY time;

Thanks,
Dave

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2014-10-14 18:29:42 Re: Partitions and work_mem?
Previous Message Tomas Vondra 2014-10-10 18:13:24 Re: Yet another abort-early plan disaster on 9.3