Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjkGW-0002Kz-8a for pgsql-performance@arkaria.postgresql.org; Mon, 12 May 2014 07:03:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WjkGV-0005im-B8 for pgsql-performance@arkaria.postgresql.org; Mon, 12 May 2014 07:03:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjkGU-0005iD-51 for pgsql-performance@postgresql.org; Mon, 12 May 2014 07:03:10 +0000 Received: from mx2.hsr.ch ([2001:620:130:a036::51]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjkGM-00087A-2v for pgsql-performance@postgresql.org; Mon, 12 May 2014 07:03:09 +0000 Received: from localhost (localhost [127.0.0.1]) by mx2.hsr.ch (Postfix) with ESMTP id 351B162DE; Mon, 12 May 2014 09:03:00 +0200 (CEST) Received: from mx2.hsr.ch ([127.0.0.1]) by localhost (mx2.hsr.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yJloq2VSLQJf; Mon, 12 May 2014 09:02:56 +0200 (CEST) Received: from webmail.hsr.ch (unknown [152.96.21.230]) by mx2.hsr.ch (Postfix) with ESMTP id 74A2C62DB; Mon, 12 May 2014 09:02:56 +0200 (CEST) Received: from sid00230.hsr.ch (152.96.21.230) by sid00230.hsr.ch (152.96.21.230) with Microsoft SMTP Server (TLS) id 15.0.847.32; Mon, 12 May 2014 09:02:55 +0200 Received: from sid00230.hsr.ch ([152.96.21.230]) by sid00230.hsr.ch ([152.96.21.230]) with mapi id 15.00.0847.030; Mon, 12 May 2014 09:02:55 +0200 From: =?iso-8859-1?Q?Phan_C=F4ng_Minh?= To: Clinton Adams CC: "pgsql-performance@postgresql.org" Subject: Re: Check memory consumption of postgresql query Thread-Topic: [PERFORM] Check memory consumption of postgresql query Thread-Index: Ac9qi69OXtKtfHiITRK6z2vtdkm40AAKen2AAL6SIiI= Date: Mon, 12 May 2014 07:02:54 +0000 Message-ID: References: <189738B9D30E5844A2F72AF45DD82A490C638ABB@SID00202.hsr.ch>, In-Reply-To: Accept-Language: en-US, de-CH Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [152.96.21.55] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 Hi Clinton, Thank you for your response. I check the article (http://www.depesz.com/201= 2/06/09/how-much-ram-is-postgresql-using/) and it seems to work with genera= l process as well.=20 However does it have anyway to calculate the memory used by single query, n= ot the whole postgresql process? Thanks, Minh ________________________________________ From: Clinton Adams Sent: Thursday, May 8, 2014 4:04 PM To: Phan C=F4ng Minh Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] Check memory consumption of postgresql query On Thu, May 8, 2014 at 3:04 AM, Phan C=F4ng Minh wrote: > Hello PostgreSQL community , > > I'm doing benchmark between column store and traditional row-oriented sto= re. > I would like to know if there is any way to measure memory consummed by a > query execution? In linux you can look at the memory usage for a particular backend in /proc/[pid]/smaps. Get the pid with pg_backend_pid() or from pg_stat_activity. For more info, check out http://www.depesz.com/2012/06/09/how-much-ram-is-postgresql-using/ - Clinton > > Thanks > Minh, > --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance