Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cya12-00074q-4G for pgsql-performance@arkaria.postgresql.org; Thu, 13 Apr 2017 08:22:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cya11-0003c2-7L for pgsql-performance@arkaria.postgresql.org; Thu, 13 Apr 2017 08:22:07 +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 1cya10-0003bj-7V for pgsql-performance@postgresql.org; Thu, 13 Apr 2017 08:22:06 +0000 Received: from nm1-vm6.bullet.mail.ir2.yahoo.com ([212.82.96.77]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cya0s-00027C-Gy for pgsql-performance@postgresql.org; Thu, 13 Apr 2017 08:22:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1492071714; bh=Nn8YOMaV7kb35HTR1ZKoa4BTxZupjMDYie6Fzqd+hK0=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=EwefCy4dNnJ7nyNTm8dfwXLoy3tUxvB6TKOaRKm0J+fsNItaOgJtK756sMlFljZkBk16FUNQrHjleh7hT58wPbJeDFUMhuYCaO/2EUBgnYI1jMhVcwMOibZH6vMw3ZoG3x14uNA7LFpXzC9JYuBvoStF/dyyy78cZdoeu7noqpQNziiBHOCKG5TaHEgWMv4nIGpUiaQ9944HaEtI/w/duuzuZFzozOGqZQejDSjjHgBDYAHentCKi8rcroH9XzudVh0ZbZXAxDyzZ4Yy0Y7uyW8zseHVbrEhPqhM4fFL5nsCxtPin5gX/PgehaOU/1v0/+MzWvIWYpefZxFU+WEgKg== Received: from [212.82.98.124] by nm1.bullet.mail.ir2.yahoo.com with NNFMP; 13 Apr 2017 08:21:54 -0000 Received: from [212.82.98.104] by tm17.bullet.mail.ir2.yahoo.com with NNFMP; 13 Apr 2017 08:21:54 -0000 Received: from [127.0.0.1] by omp1041.mail.ir2.yahoo.com with NNFMP; 13 Apr 2017 08:21:54 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 773004.63303.bm@omp1041.mail.ir2.yahoo.com X-YMail-OSG: e7uTwNoVM1kI.JygHc83regzhdRvqkzsyOQRDCnuCqXYjjxLeimzvY.iXA5EQ8x JJiX5DX3zf8UJ.7XeodkmeEI4i0BstJxs8UZFR37MHykrqQFm96clcRBVNPO3F8D_8HLrqMNTg_Y S4Y1fsxllXyvBCItc.ycw2ysCbdpTS0HyqCQEGTklGg53CHPKhRwwFD5eVZrZeIK_t4U052ia1qX vCumkjuqVdSKji_v2aieDUQSl80TAqIUpfjUfLENsVxCXufsqEAFO8T0s6YtlQ5jSZ7dVDSkaxf3 Aul74qAlxWd3L1RrIS4pK3MEFkPIsdT4.aXBvZtpZnqUj.ah1U5.KYh0LsN0lGIDn1HyLsUEBsdf x73fxITuQOa1rzvr5Ou9FqFj7WKcW__d3Zl0mI4Y6maIMvGwtLYW6LJ2YzOu8NolvA.MWBu.5j_G pucPo7ldPAOt5QsGq8cSFYxa1a.GBSPJBnmo67wP7QUh7HsQL9vNvA4MCUbI1TfMKmzcK3rLQusY .uB18HhAGtoGfrumgcPfA3qQh5anjSQ-- Received: from jws700037.mail.ir2.yahoo.com by sendmailws165.mail.ir2.yahoo.com; Thu, 13 Apr 2017 08:21:54 +0000; 1492071714.238 Date: Thu, 13 Apr 2017 08:21:53 +0000 (UTC) From: Glyn Astill Reply-To: Glyn Astill To: Daulat Ram , "pgsql-performance@postgresql.org" Message-ID: <811150671.1545494.1492071713992@mail.yahoo.com> In-Reply-To: References: Subject: Re: Hi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.9386 YahooMailNeo Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 Content-Length: 1318 X-Pg-Spam-Score: -2.0 (--) 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 > From: Daulat Ram > To: "pgsql-performance@postgresql.org" > Sent: Thursday, 13 April 2017, 7:25 > Subject: [PERFORM] Hi > > Hello, > > I need to know the criteria behind for settings the work_mem in PostgreSQL, please give the example also if possible. > > Regards, > Daulat Is there anything in particular from the manual pages you don't understand? It should be quite clear: https://www.postgresql.org/docs/current/static/runtime-config-resource.html "Specifies the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files. The value defaults to four megabytes (4MB). Note that for a complex query, several sort or hash operations might be running in parallel; each operation will be allowed to use as much memory as this value specifies before it starts to write data into temporary files." "Also, several running sessions could be doing such operations concurrently. Therefore, the total memory used could be many times the value of work_mem; it is necessary to keep this fact in mind when choosing the value. Sort operations are used for ORDER BY, DISTINCT, and merge joins. Hash tables are used in hash joins, hash-based aggregation, and hash-based processing of IN subqueries." Glyn -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance