pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedCheck memory consumption of postgresql query
4+ messages / 3 participants
[nested] [flat]
* Check memory consumption of postgresql query
@ 2014-05-08 07:04 Phan Công Minh <cphan@hsr.ch>
0 siblings, 1 reply; 4+ messages in thread
From: Phan Công Minh @ 2014-05-08 07:04 UTC (permalink / raw)
To: pgsql-performance
Hello PostgreSQL community ,
I'm doing benchmark between column store and traditional row-oriented store. I would like to know if there is any way to measure memory consummed by a query execution?
Thanks
Minh,
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Check memory consumption of postgresql query
@ 2014-05-08 14:04 Clinton Adams <clinton.adams@gmail.com>
parent: Phan Công Minh <cphan@hsr.ch>
0 siblings, 1 reply; 4+ messages in thread
From: Clinton Adams @ 2014-05-08 14:04 UTC (permalink / raw)
To: Phan Công Minh <cphan@hsr.ch>; +Cc: pgsql-performance
On Thu, May 8, 2014 at 3:04 AM, Phan Công Minh <cphan@hsr.ch> wrote:
> Hello PostgreSQL community ,
>
> I'm doing benchmark between column store and traditional row-oriented store.
> 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,
>
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Check memory consumption of postgresql query
@ 2014-05-12 07:02 Phan Công Minh <cphan@hsr.ch>
parent: Clinton Adams <clinton.adams@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Phan Công Minh @ 2014-05-12 07:02 UTC (permalink / raw)
To: Clinton Adams <clinton.adams@gmail.com>; +Cc: pgsql-performance
Hi Clinton,
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?
Thanks,
Minh
________________________________________
From: Clinton Adams <clinton.adams@gmail.com>
Sent: Thursday, May 8, 2014 4:04 PM
To: Phan Công 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ông Minh <cphan@hsr.ch> wrote:
> Hello PostgreSQL community ,
>
> I'm doing benchmark between column store and traditional row-oriented store.
> 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,
>
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Check memory consumption of postgresql query
@ 2014-05-12 16:38 Matheus de Oliveira <matioli.matheus@gmail.com>
parent: Phan Công Minh <cphan@hsr.ch>
0 siblings, 0 replies; 4+ messages in thread
From: Matheus de Oliveira @ 2014-05-12 16:38 UTC (permalink / raw)
To: Phan Công Minh <cphan@hsr.ch>; +Cc: Clinton Adams <clinton.adams@gmail.com>; 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
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2014-05-12 16:38 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-05-08 07:04 Check memory consumption of postgresql query Phan Công Minh <cphan@hsr.ch>
2014-05-08 14:04 ` Clinton Adams <clinton.adams@gmail.com>
2014-05-12 07:02 ` Phan Công Minh <cphan@hsr.ch>
2014-05-12 16:38 ` Matheus de Oliveira <matioli.matheus@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox