Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U9HV5-0006VT-7d for pgsql-performance@arkaria.postgresql.org; Sat, 23 Feb 2013 15:58:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U9HV4-0007Dg-Mr for pgsql-performance@arkaria.postgresql.org; Sat, 23 Feb 2013 15:58:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U9HR3-00073B-BK for pgsql-performance@postgresql.org; Sat, 23 Feb 2013 15:54:49 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U9HQz-0000Eb-DA for pgsql-performance@postgresql.org; Sat, 23 Feb 2013 15:54:47 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id E9C2C2A9CF; Sat, 23 Feb 2013 07:54:41 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id E5FC940189; Sat, 23 Feb 2013 07:54:41 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id EEF091219E6; Sat, 23 Feb 2013 07:57:54 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0LL8uDcMv6xu; Sat, 23 Feb 2013 07:57:54 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id BCE841219C5; Sat, 23 Feb 2013 07:57:54 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Sat, 23 Feb 2013 07:57:53 -0800 (PST) Message-ID: <5128E632.2040209@vmware.com> Date: Sat, 23 Feb 2013 17:54:26 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Markus Schulz CC: pgsql-performance@postgresql.org Subject: Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds References: <201302220925.26460.msc@antzsystem.de> <5127741D.6090907@vmware.com> <201302221910.25271.msc@antzsystem.de> In-Reply-To: <201302221910.25271.msc@antzsystem.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.6 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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