Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z094f-0003vW-AX for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2015 13:51:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z094e-0000w1-QZ for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2015 13:51:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z094c-0000tM-Vt for pgsql-performance@postgresql.org; Wed, 03 Jun 2015 13:51:15 +0000 Received: from mail-wi0-f170.google.com ([209.85.212.170]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z094Z-000639-RC for pgsql-performance@postgresql.org; Wed, 03 Jun 2015 13:51:13 +0000 Received: by wiwd19 with SMTP id d19so53485830wiw.0 for ; Wed, 03 Jun 2015 06:51:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=eQi8MeSkbDbzlw8RAL49QcCNkNJJiMF/RNQqI8QGE4k=; b=ImlnvAhaCLUCpW7K0tzaXD1jhYK1FRTtoIx4JTWuCQfi+fcTmAQT/uG/RJjH3LgeA1 34m1sPAfo20iuGWdR3MDgtyiXjFjAzd4e+ELD+fjs3dLJNNnlY9D+hhFvv92I0sDmasr LJq6zDL+B3pXpAPQXtLbi6J8FHKw5Lg1b3aISYhOZ35srYJP4b0dOgcS9RAHHqHa7tUi UhUiNhjPdqkzg/5QvgJ4VSyQgdhMWGCevDix7c5LGtI6Fd7V4vJxXGzpSnDqWVP1e+QV ZrqsnsBduxoioeL9C6J6VTLaJjJA8cbb2df1jPKzk2wECYpHkMbbf9BJNacw0OvL2jZ7 iHfA== X-Gm-Message-State: ALoCoQk0NUSSEZyw8sNVvSov3eyYRn2U2OT+JvGDE0Gtca5cHBk1u4jm3XbVD/W50j9ZRWxx6RfHRi+ihJCsXYEorJnDh+ItAA8mLoi8v/n42YliC9+1qrZhhJ7kTljwaY6KsaqrXVzaZt0FBvh1T9bQAsT6pRNxIwunVsTx2RJjU1fTo9iH8t1oi2N7GwxuNEDS2RfP2fnuY0hc83SjkkKQyB73MRqHJw== X-Received: by 10.194.95.41 with SMTP id dh9mr62110793wjb.55.1433339470093; Wed, 03 Jun 2015 06:51:10 -0700 (PDT) Received: from [10.137.2.12] (ip-89-176-99-192.net.upcbroadband.cz. [89.176.99.192]) by mx.google.com with ESMTPSA id b20sm1182661wjb.46.2015.06.03.06.51.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 06:51:09 -0700 (PDT) Message-ID: <556F0649.9000402@2ndquadrant.com> Date: Wed, 03 Jun 2015 15:51:05 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: How to reduce writing on disk ? (90 gb on pgsql_tmp) References: <1433334092106-5852321.post@n5.nabble.com> <1433337082772-5852328.post@n5.nabble.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 06/03/15 15:27, chiru r wrote: > Hi Benjamin, > > It looks you are facing disk space issue for queries. > In order to avid the disk space issue you can do the following. > 1) Increase the work_mem parameter session level before executing the > queries. > 2) If you observe diskspace issue particular user queries,increase the > work_mem parameter user level. The suggestion to increase work_mem is a bit naive, IMHO. The query is writing ~95GB to disk, it usually takes more space to keep the same data in memory. They only have 64GB of RAM ... In the good case, it will crash just like now. In the worse case, the OOM killer will intervene, possibly crashing the whole database. > 3) Check with developer to tune the query. That's a better possibility. Sadly, we don't know what the query is doing, so we can't judge how much it can be optimized. -- Tomas Vondra http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance