Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0HAa-00086n-Ha for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2015 22:29:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z0HAZ-00013Y-Df for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2015 22:29:55 +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 1Z0HAX-00013N-5a for pgsql-performance@postgresql.org; Wed, 03 Jun 2015 22:29:53 +0000 Received: from lists.commandprompt.com ([69.168.55.30]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Z0HAP-0007MZ-68 for pgsql-performance@postgresql.org; Wed, 03 Jun 2015 22:29:51 +0000 Received: from [192.168.1.3] (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id 793C739B; Wed, 3 Jun 2015 15:29:43 -0700 (PDT) Received: from [192.168.1.3] ([67.168.169.165] helo=[192.168.1.3]) by assp.commandprompt.com with ESMTPS(AES128-SHA) (2.1.1); 3 Jun 2015 15:29:43 -0700 Message-ID: <556F7FD8.5070802@commandprompt.com> Date: Wed, 03 Jun 2015 15:29:44 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Tomas Vondra , Scott Marlowe CC: "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> <556F0649.9000402@2ndquadrant.com> <9DED5F42-2C51-4CDE-A179-56A8A9370338@playrion.com> <556F15AD.4040801@2ndquadrant.com> <556F547D.5040206@2ndquadrant.com> <556F7CAA.2080003@2ndquadrant.com> In-Reply-To: <556F7CAA.2080003@2ndquadrant.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Assp-Version: 2.1.1(11364) on assp.commandprompt.com X-Assp-Client-SSL: yes X-Assp-ID: assp.commandprompt.com m1-70583-00119 X-Assp-Envelope-From: jd@commandprompt.com X-Assp-Intended-For: pgsql-performance@postgresql.org X-Assp-Original-Subject: Re: [PERFORM] How to reduce writing on disk ? (90 gb on pgsql_tmp) X-Pg-Spam-Score: -1.9 (-) 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/2015 03:16 PM, Tomas Vondra wrote: > What is more important, though, is the amount of memory. OP reported the > query writes ~95GB of temp files (and dies because of full disk, so > there may be more). The on-disk format is usually more compact than the > in-memory representation - for example on-disk sort often needs 3x less > space than in-memory qsort. So we can assume the query needs >95GB of > data. Can you explain how that's going to fit into the 64GB RAM? > >> Cache is free memory. If you think of it any other way when you're >> looking at memory usage and pressure on theings like swap you're >> gonna make some bad decisions. > > Cache is not free memory - it's there for a purpose and usually plays a > significant role in performance. Sure, it may be freed and used for > other purposes, but that has consequences - e.g. it impacts performance > of other queries etc. You generally don't want to do that on production. Exactly. If your cache is reduced your performance is reduced because less things are in cache. It is not free memory. Also the command "free" is not useful in this scenario. It is almost always better to use sar so you can see where the data points are that free is using. Sincerely, JD -- Command Prompt, Inc. - http://www.commandprompt.com/ 503-667-4564 PostgreSQL Centered full stack support, consulting and development. Announcing "I'm offended" is basically telling the world you can't control your own emotions, so everyone else should do it for you. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance