From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Kevin Grittner <kgrittn@gmail.com>
Cc: rotten@windfish.net, "pgsql-bugs\@postgresql.org" <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14290: materialized view refresh doesn't use temp_tablespace
Date: Wed, 24 Aug 2016 19:53:49 +0100
Message-ID: <87wpj69fki.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CACjxUsPFntYLoqZzApHXLY3_Wqd5DE228HXC7DiRmmKs8G2QYQ@mail.gmail.com>
References: <20160818190623.1529.12440@wrigleys.postgresql.org>
<CACjxUsPFntYLoqZzApHXLY3_Wqd5DE228HXC7DiRmmKs8G2QYQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
>>>>> "Kevin" == Kevin Grittner <kgrittn@gmail.com> writes:
Kevin> You are confusing two completely different things: temporary
Kevin> objects (created by statements starting with CREATE TEMPORARY)
Kevin> and temporary files (created when data spills to disk during,
Kevin> for example, a sort, hash, or materialization of data internal
Kevin> to processing some statement). The former are placed based on
Kevin> temp_tablespaces; the latter are normally placed in the
Kevin> base/pgsql_tmp/ subdirectory.
This is not true.
If temp_tablespaces is set, then all sort / hash / materialization files
will use the list of tablespaces in temp_tablespaces on a rotational
basis (to spread load). The only exception is for temp files that might
have to outlive the current transaction; these are forced into the
default tablespace of the current database. See storage/file/fd.c
However, materialized view refresh (without CONCURRENTLY) needs the new
copy of the matview's data to be in the same tablespace as the old copy,
since it moves the data into place via a heap swap. This restriction
does not apply to sort/hash/materialization files created by the
matview's query.
--
Andrew (irc:RhodiumToad)
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: andrew@tao11.riddles.org.uk, kgrittn@gmail.com
Subject: Re: BUG #14290: materialized view refresh doesn't use temp_tablespace
In-Reply-To: <87wpj69fki.fsf@news-spur.riddles.org.uk>
References: <20160818190623.1529.12440@wrigleys.postgresql.org> <CACjxUsPFntYLoqZzApHXLY3_Wqd5DE228HXC7DiRmmKs8G2QYQ@mail.gmail.com> <87wpj69fki.fsf@news-spur.riddles.org.uk>
* 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