Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paesold <mpaesold(at)gmx(dot)at>, pgsql-hackers(at)postgreSQL(dot)org, pgsql-jdbc(at)postgreSQL(dot)org
Subject: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work
Date: 2008-04-01 14:26:52
Message-ID: A89C6CD8-333A-4BE9-AC22-5F1181B95886@fastcrypt.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbc
So if I write

conn.prepareStatement("select col from table where col like ?")

then setString(1,'hello%')

The driver will do

prepare foo as select col from table where col like $1

and then

execute foo('hello%')

this will take advantage of the strategy automatically ?

If so this should be changed. The driver does this all the time.

Dave

On 1-Apr-08, at 10:06 AM, Tom Lane wrote:

> Dave Cramer <pg(at)fastcrypt(dot)com> writes:
>> Was the driver ever changed to take advantage of the above strategy?
>
> Well, it's automatic as long as you use the unnamed statement.  About
> all that might need to be done on the client side is to use unnamed
> statements more often in preference to named ones, and I believe that
> something like that did get done in JDBC.
>
> 			regards, tom lane
>
> -- 
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers


In response to

pgsql-hackers by date

Next:From: PFCDate: 2008-04-01 14:43:58
Subject: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work
Previous:From: Tom LaneDate: 2008-04-01 14:22:03
Subject: Re: [HACKERS] ANALYZE getting dead tuple count hopelessly wrong

pgsql-jdbc by date

Next:From: PFCDate: 2008-04-01 14:43:58
Subject: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work
Previous:From: Michael PaesoldDate: 2008-04-01 14:21:34
Subject: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group