pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Silvio Brandani <silvio.brandani@tech.sdb.it>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: out of memory error
Date: Fri, 06 Aug 2010 11:43:31 -0400
Message-ID: <1281109308-sup-669@alvh.no-ip.org> (raw)
In-Reply-To: <4C5BF885.9060105@tech.sdb.it>
References: <288793.40690.qm@web39707.mail.mud.yahoo.com>
	<4C5BC43B.7050503@tech.sdb.it>
	<4C5BF885.9060105@tech.sdb.it>

Excerpts from Silvio Brandani's message of vie ago 06 07:56:53 -0400 2010:

> it seems the execution plan is different for this query when run from 
> the application versus the psql . How can I check the execution plan of 
> a query run by a user??
> I can set explain analyze for the query via psql but how can I check 
> with application running the query???

If this is a prepared query, then that is a good guess.  You can see the
real plan that the application is getting in psql by explaining the
execution of a prepared statement like this:

PREPARE foo(int, text) AS SELECT blah FROM foo, bar WHERE foo.id = $1 AND ...
EXPLAIN ANALYZE EXECUTE foo(someval, another);

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (42+ messages)  latest in thread

Message-ID: <1281109308-sup-669@alvh.no-ip.org>
Permalink:  ../1281109308-sup-669@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1281109308-sup-669@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: alvherre@commandprompt.com, silvio.brandani@tech.sdb.it
  Subject: Re: out of memory error
  In-Reply-To: <1281109308-sup-669@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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