Memory consumption for Query

Started by dhaval jaiswalalmost 9 years ago3 messagesgeneral
Jump to latest
#1dhaval jaiswal
dhavallj@hotmail.com

How to check how much memory query is consuming.

Is there tool can check of query consuming memory for the execution or output.

Let's say for following query how to calculate memory consumption.

select * from test where id=1;

Sent from Outlook<http://aka.ms/weboutlook&gt;

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: dhaval jaiswal (#1)
Re: Memory consumption for Query

dhaval jaiswal wrote:

How to check how much memory query is consuming.

Is there tool can check of query consuming memory for the execution or output.

Let's say for following query how to calculate memory consumption.

select * from test where id=1;

That query will not consume memory worth mention unless
"test" is a non-trivial view.

You can run "EXPLAIN (ANALYZE) SELECT ..." to see how much memory is used
for memory intense operations like sort, hash or materialize.

Other operations don't really consume much memory.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3dhaval jaiswal
dhavallj@hotmail.com
In reply to: Laurenz Albe (#2)
Re: Memory consumption for Query

Other operations don't really consume much memory.

Is there any way to find out that as well.

You can run "EXPLAIN (ANALYZE) SELECT ..." to see how much memory is used

for memory intense operations like sort, hash or materialize.

I am aware of it.

Sent from Outlook<http://aka.ms/weboutlook&gt;

________________________________
From: Albe Laurenz <laurenz.albe@wien.gv.at>
Sent: Monday, April 24, 2017 12:54 PM
To: 'dhaval jaiswal *EXTERN*'; PostgreSQL General
Subject: RE: Memory consumption for Query

dhaval jaiswal wrote:

How to check how much memory query is consuming.

Is there tool can check of query consuming memory for the execution or output.

Let's say for following query how to calculate memory consumption.

select * from test where id=1;

That query will not consume memory worth mention unless
"test" is a non-trivial view.

You can run "EXPLAIN (ANALYZE) SELECT ..." to see how much memory is used
for memory intense operations like sort, hash or materialize.

Other operations don't really consume much memory.

Yours,
Laurenz Albe