Re: Check memory consumption of postgresql query - Mailing list pgsql-performance

From Matheus de Oliveira
Subject Re: Check memory consumption of postgresql query
Date
Msg-id CAJghg4+1mcK1KdunxZHYbL2hQgDz-C2XohKZPbBnQVCO_+oGig@mail.gmail.com
Whole thread Raw
In response to Re: Check memory consumption of postgresql query  (Phan Công Minh <cphan@hsr.ch>)
List pgsql-performance

On Mon, May 12, 2014 at 4:02 AM, Phan Công Minh <cphan@hsr.ch> wrote:
Thank you for your response. I check the article (http://www.depesz.com/2012/06/09/how-much-ram-is-postgresql-using/) and it seems to work with general process as well.
However does it have anyway to calculate the memory used by single query, not the whole postgresql process?

You can check only the /proc/<pid>/ for the backend you are interested in. Also, an EXPLAIN ANALYZE of your qurey will show memory used by some operations (like sort, hash, etc.), those are limited by the work_mem parameter, so if you are working on benchmarks, you may want to tune that properly.

Regards,
--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres

pgsql-performance by date:

Previous
From: Jeff Janes
Date:
Subject: Re: 9.2.4 vs 9.3.0 query planning (sort merge join vs hash join)
Next
From: Michael Stone
Date:
Subject: Re: Specifications for a new server