From: Rick Otten <rotten@windfish.net>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14290: materialized view refresh doesn't use temp_tablespace
Date: Wed, 24 Aug 2016 06:19:32 -0400
Message-ID: <763fbff79441cfde6dc68b0ad2877c21@www.windfish.net> (raw)
In-Reply-To: <CAB7nPqTOZJ9AnPweC3rRZ+mku6xo0Z0DZ3C7vsYpY2=KMSNUfA@mail.gmail.com>
References: <20160818190623.1529.12440@wrigleys.postgresql.org>
<CAB7nPqTOZJ9AnPweC3rRZ+mku6xo0Z0DZ3C7vsYpY2=KMSNUfA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Refreshing materialized views can definitely create temporary objects.
They even get logged when I turn on logging of temporary objects.
On 2016-08-24 03:47, Michael Paquier wrote:
> On Fri, Aug 19, 2016 at 4:06 AM, <rotten@windfish.net> wrote:
>
>> I've recently observed that if while refreshing a materialized view, temp space is required, it will not use the default temp_tablespaces defined in postgresql.conf. Instead it uses the tablespace where the materialized view lives. If this can't be easily changed to use the default temp tablespaces, it would be good if the documentation were updated to alert materialized view users to this caveat. Refreshing a materialized view may use as much temporary space, or more, than its current size. For example, I have a 100G materialized view. Refreshing it uses almost 300G additional disk while the refresh is running.
>
> Per the docs:
> https://www.postgresql.org/docs/9.6/static/runtime-config-client.html [1]
> This variable specifies tablespaces in which to create temporary
> objects (temp tables and indexes on temp tables) when a CREATE command
> does not explicitly specify a tablespace. Temporary files for purposes
> such as sorting large data sets are also created in these tablespaces.
>
> And as far as I know, there is no concept of temporary object for
> matviews, so the documentation is correct IMO, and the behavior you
> are seeing expected.
Links:
------
[1]
https://www.postgresql.org/docs/9.6/static/runtime-config-client.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: rotten@windfish.net, michael.paquier@gmail.com
Subject: Re: BUG #14290: materialized view refresh doesn't use temp_tablespace
In-Reply-To: <763fbff79441cfde6dc68b0ad2877c21@www.windfish.net>
References: <20160818190623.1529.12440@wrigleys.postgresql.org> <CAB7nPqTOZJ9AnPweC3rRZ+mku6xo0Z0DZ3C7vsYpY2=KMSNUfA@mail.gmail.com> <763fbff79441cfde6dc68b0ad2877c21@www.windfish.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox