Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGguA-0006hr-VZ for pgsql-general@arkaria.postgresql.org; Mon, 20 Nov 2017 07:54:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eGguA-00026H-7q for pgsql-general@arkaria.postgresql.org; Mon, 20 Nov 2017 07:54:10 +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 1eGgu7-00024t-Mm for pgsql-general@postgresql.org; Mon, 20 Nov 2017 07:54:07 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eGgu4-00043P-Uc for pgsql-general@postgresql.org; Mon, 20 Nov 2017 07:54:06 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 6FCF84D853; Mon, 20 Nov 2017 08:54:02 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id bEUOb3Bwd2Ze; Mon, 20 Nov 2017 08:54:00 +0100 (CET) Message-ID: <1511161692.2567.5.camel@cybertec.at> Subject: Re: Query Using Massive Temp Space From: Laurenz Albe To: Cory Tucker , "pgsql-general@postgresql.org" In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Date: Mon, 20 Nov 2017 08:08:12 +0100 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Cory Tucker wrote: > I have a query that is using a tremendous amount of temp disk space given the overall size of the dataset. > I'd love for someone to try to explain what PG is doing and why its using so much space for the query. It could be a sort or a hash operation. Do determine what is going on, EXPLAIN (ANALYZE, BUFFERS) output would be useful. Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general