pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Markus Schulz <msc@antzsystem.de>
Cc: pgsql-performance@postgresql.org
Subject: Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds
Date: Sat, 23 Feb 2013 17:54:26 +0200
Message-ID: <5128E632.2040209@vmware.com> (raw)
In-Reply-To: <201302221910.25271.msc@antzsystem.de>
References: <201302220925.26460.msc@antzsystem.de>
	<5127741D.6090907@vmware.com>
	<201302221910.25271.msc@antzsystem.de>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 22.02.2013 20:10, Markus Schulz wrote:
> Am Freitag, 22. Februar 2013, 14:35:25 schrieb Heikki Linnakangas:
>> You could check what the generic plan looks like by taking the query
>> used in the java program, with the parameter markers, and running
>> EXPLAIN on that.
>
> how can i do this?
> I've tried the following in my ejb-test-function to:
>
> String query = "..."
> entitymanager.createNativeQuery(query)...;
> entitymanager.createNativeQuery("EXPLAIN ANALYZE " + query)...;
>
> but the second createNativeQuery call runs fast every time and will show the
> same plan and the first hangs after the fourth call to this function.

You can take the query, replace the ? parameter markers with $1, $2, and 
so forth, and explain it with psql like this:

prepare foo (text) as select * from mytable where id = $1;
explain analyze execute foo ('foo');

On 9.2, though, this will explain the specific plan for those 
parameters, so it might not be any different from what you already 
EXPLAINed.

- Heikki


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



view thread (6+ messages)  latest in thread

Message-ID: <5128E632.2040209@vmware.com>
Permalink:  ../5128E632.2040209@vmware.com/
Also on:    postgresql.org/message-id/5128E632.2040209@vmware.com

 · 

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-performance@postgresql.org
  Cc: hlinnakangas@vmware.com, msc@antzsystem.de
  Subject: Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds
  In-Reply-To: <5128E632.2040209@vmware.com>

* 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