Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcdJJ-0005ck-PL for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Aug 2016 18:54:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bcdJI-0000T2-Ux for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Aug 2016 18:54:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bcdJI-0000ST-4A for pgsql-bugs@postgresql.org; Wed, 24 Aug 2016 18:54:00 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bcdJB-0007Pl-63 for pgsql-bugs@postgresql.org; Wed, 24 Aug 2016 18:53:58 +0000 Received: from localhost ([127.0.0.1]:49166 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.84 (FreeBSD)) (envelope-from ) id 1bcdJ7-000Nki-Pw; Wed, 24 Aug 2016 18:53:49 +0000 From: Andrew Gierth To: Kevin Grittner Cc: rotten@windfish.net, "pgsql-bugs\@postgresql.org" Subject: Re: BUG #14290: materialized view refresh doesn't use temp_tablespace In-Reply-To: (Kevin Grittner's message of "Wed, 24 Aug 2016 12:46:33 -0500") Message-ID: <87wpj69fki.fsf@news-spur.riddles.org.uk> References: <20160818190623.1529.12440@wrigleys.postgresql.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) Date: Wed, 24 Aug 2016 19:53:49 +0100 MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -2.1 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org >>>>> "Kevin" == Kevin Grittner 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