pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Prepared Statements
19+ messages / 15 participants
[nested] [flat]

* Prepared Statements
@ 2003-10-22 17:37  Eric Dahnke <edahnke@nyc.yamaha.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Eric Dahnke @ 2003-10-22 17:37 UTC (permalink / raw)
  To: pgsql-general


Does anyone know the exact definition of a Prepared Statement? 

     String sql = "SELECT count(id) FROM customer";
     executeQuery(sql);

I assume the sql string is a prepared statement? Semantic debate here. -
Thx 




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2003-10-22 21:54  Peter Eisentraut <peter_e@gmx.net>
  parent: Eric Dahnke <edahnke@nyc.yamaha.com>
  0 siblings, 0 replies; 19+ messages in thread

From: Peter Eisentraut @ 2003-10-22 21:54 UTC (permalink / raw)
  To: Eric Dahnke <edahnke@nyc.yamaha.com>; +Cc: pgsql-general

Eric Dahnke writes:

> Does anyone know the exact definition of a Prepared Statement?

There are multiple levels at which you can prepare a statement.  If you
just want a semantic debate, then there is no definite answer.  If you
have a particular application problem, please state it.

-- 
Peter Eisentraut   peter_e@gmx.net




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Prepared Statements
@ 2008-01-09 19:02  mljv@planwerk6.de
  0 siblings, 2 replies; 19+ messages in thread

From: mljv@planwerk6.de @ 2008-01-09 19:02 UTC (permalink / raw)
  To: pgsql-general

Hi,

i am trying to understand "Prepared Statements". I am asking because i want to 
understand the impact of "Prepared statements" to my application.

Actually i use Hibernate, DBCP Connection Pool with Postgresql-JDBC Driver and 
Postgresql 8.1.

- I know there is a PREPARE Statement in Postgresql and read the docs. 
- in PostgresqlJDBC i have a prepareThreshold parameter which i left to 
default of 5. 
- in DBCP i have a property "poolPreparedStatements", set to true. Does ist 
just configure prepareThreshold of JDBC or does it maintain a statementPool 
of it's own? 

In my Log files of postgresql each query is called like this:

    EXECUTE <unnamed> [PREPARE: select ...]

I have not found anything about preparing "unnamed" statements. What does it 
mean?

many questions, but i was googling a lot and "Prepared Statement" is a 
somewhat ambiguous expression, isn't it? Can someone clarify this to me, 
please?

kind regards,
Janning






^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2008-01-09 19:50  Martin Gainty <mgainty@hotmail.com>
  parent: mljv@planwerk6.de
  1 sibling, 0 replies; 19+ messages in thread

From: Martin Gainty @ 2008-01-09 19:50 UTC (permalink / raw)
  To: mljv@planwerk6.de; pgsql-general

straight from jdbc2.1 doc
http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec2/jdbc2.1.frame6.html
Statement
Statement object to submit a set of heterogeneous update commands together
as a single unit, or batch, to the underlying DBMS
i.e. execute Statement without parameters
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html

PreparedStatement
An element in a batch consists of a parameterized command and an associated
set of parameters when a PreparedStatement is used. (i.e. A Statement with
params)
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html

CallableStatement
Multiple sets of input parameter values may be associated with a callable
statement and sent to the DBMS together.
(For procedures)
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/CallableStatement.html

Viel Gluck
Martin
----- Original Message -----
From: <mljv@planwerk6.de>
To: <pgsql-general@postgresql.org>
Sent: Wednesday, January 09, 2008 2:02 PM
Subject: [GENERAL] Prepared Statements


> Hi,
>
> i am trying to understand "Prepared Statements". I am asking because i
want to
> understand the impact of "Prepared statements" to my application.
>
> Actually i use Hibernate, DBCP Connection Pool with Postgresql-JDBC Driver
and
> Postgresql 8.1.
>
> - I know there is a PREPARE Statement in Postgresql and read the docs.
> - in PostgresqlJDBC i have a prepareThreshold parameter which i left to
> default of 5.
> - in DBCP i have a property "poolPreparedStatements", set to true. Does
ist
> just configure prepareThreshold of JDBC or does it maintain a
statementPool
> of it's own?
>
> In my Log files of postgresql each query is called like this:
>
>     EXECUTE <unnamed> [PREPARE: select ...]
>
> I have not found anything about preparing "unnamed" statements. What does
it
> mean?
>
> many questions, but i was googling a lot and "Prepared Statement" is a
> somewhat ambiguous expression, isn't it? Can someone clarify this to me,
> please?
>
> kind regards,
> Janning
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/
>




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2008-01-09 20:16  Kris Jurka <books@ejurka.com>
  parent: mljv@planwerk6.de
  1 sibling, 1 reply; 19+ messages in thread

From: Kris Jurka @ 2008-01-09 20:16 UTC (permalink / raw)
  To: mljv@planwerk6.de; +Cc: pgsql-general



On Wed, 9 Jan 2008, mljv@planwerk6.de wrote:

> - I know there is a PREPARE Statement in Postgresql and read the docs.
> - in PostgresqlJDBC i have a prepareThreshold parameter which i left to
> default of 5.
> - in DBCP i have a property "poolPreparedStatements", set to true. Does ist
> just configure prepareThreshold of JDBC or does it maintain a statementPool
> of it's own?

The postgresql JDBC driver does not have a statement pool of its own, so 
the two options prepareThreshold and poolPreparedStatements are 
complementary.  By itself the JDBC driver will switch to a long term 
prepared plan once you've used the exact same PreparedStatement object 
prepareThreshold number of times.  Since it doesn't pool things behind the 
scenes, you've got to retain a reference to the same PreparedStatement 
object which is difficult or impossible in many applications.  This is 
where the DBCP statement pool comes in.  It proxies PreparedStatement 
wrappers to one underlying PG PreparedStatement object so that you can hit 
prepareThreshold.

> In my Log files of postgresql each query is called like this:
>
>    EXECUTE <unnamed> [PREPARE: select ...]
>
> I have not found anything about preparing "unnamed" statements. What 
> does it mean?
>

Unnamed statements are what the driver uses before it hits the 
prepareThreshold limit.  Once it has determined the statement will be 
reused many times it changes to a named statement that has a longer 
lifespan.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2008-01-10 10:53  mljv@planwerk6.de
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 2 replies; 19+ messages in thread

From: mljv@planwerk6.de @ 2008-01-10 10:53 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-general

first: thanks a lot for your answer. it already helped me a lot, but i still 
have some questions:

Am Mittwoch, 9. Januar 2008 21:16 schrieb Kris Jurka:
> On Wed, 9 Jan 2008, mljv@planwerk6.de wrote:
> > - I know there is a PREPARE Statement in Postgresql and read the docs.
> > - in PostgresqlJDBC i have a prepareThreshold parameter which i left to
> > default of 5.
> > - in DBCP i have a property "poolPreparedStatements", set to true. Does
> > ist just configure prepareThreshold of JDBC or does it maintain a
> > statementPool of it's own?
>
> The postgresql JDBC driver does not have a statement pool of its own, so
> the two options prepareThreshold and poolPreparedStatements are
> complementary.  By itself the JDBC driver will switch to a long term
> prepared plan once you've used the exact same PreparedStatement object
> prepareThreshold number of times. Since it doesn't pool things behind the 
> scenes, you've got to retain a reference to the same PreparedStatement
> object which is difficult or impossible in many applications.  

ah! So it doesn't help if it's the same statement, it has to be the same 
object! So DBCP has a statement pool like a map, say
Map<String, PreparedStatement>
so it can fetch the reference to already existing prepared Statement by 
looking at the statement itself, right?

But JDBC itself uses the "PREPARE" sql command, right? 
So the statement is not really unnamed its name is "<unnamed>" like
prepare "<unnamed>" as select * from table;
execute "<unnamed>";

But i can't see any DEALLOCATE statements in my log file.

> This is 
> where the DBCP statement pool comes in.  It proxies PreparedStatement
> wrappers to one underlying PG PreparedStatement object so that you can hit
> prepareThreshold.
>
> > In my Log files of postgresql each query is called like this:
> >
> >    EXECUTE <unnamed> [PREPARE: select ...]
> >
> > I have not found anything about preparing "unnamed" statements. What
> > does it mean?
>
> Unnamed statements are what the driver uses before it hits the
> prepareThreshold limit.  Once it has determined the statement will be
> reused many times it changes to a named statement that has a longer
> lifespan.

What do you mean with "longer lifespan"? Doesn't the JDBC driver uses the 
PREPARE Sql Statement and therefore the prepared Statement has the same 
lifespan as the connection? If so, as connections are pooled and never 
closed, the prepared Statement will last forever. What if the table analyzes 
changes and a better execution plan could be found? 

kind regards,
janning




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2008-01-10 12:12  Isak Hansen <isak.hansen@gmail.com>
  parent: mljv@planwerk6.de
  1 sibling, 0 replies; 19+ messages in thread

From: Isak Hansen @ 2008-01-10 12:12 UTC (permalink / raw)
  To: mljv@planwerk6.de <mljv@planwerk6.de>; +Cc: Kris Jurka <books@ejurka.com>; pgsql-general

On 1/10/08, mljv@planwerk6.de <mljv@planwerk6.de> wrote:
> > >
> > > I have not found anything about preparing "unnamed" statements. What
> > > does it mean?
> >
> > Unnamed statements are what the driver uses before it hits the
> > prepareThreshold limit.  Once it has determined the statement will be
> > reused many times it changes to a named statement that has a longer
> > lifespan.
>
> What do you mean with "longer lifespan"? Doesn't the JDBC driver uses the
> PREPARE Sql Statement and therefore the prepared Statement has the same
> lifespan as the connection? If so, as connections are pooled and never
> closed, the prepared Statement will last forever. What if the table analyzes
> changes and a better execution plan could be found?
>

An unnamed prepared query is just a normal one-shot query, but it
allows the use of bind variables.

You'll find more details in the protocol section of the postgres docs
<http://www.postgresql.org/docs/8.3/static/protocol.html;.


Regards,
Isak



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2008-01-12 22:04  Kris Jurka <books@ejurka.com>
  parent: mljv@planwerk6.de
  1 sibling, 1 reply; 19+ messages in thread

From: Kris Jurka @ 2008-01-12 22:04 UTC (permalink / raw)
  To: mljv@planwerk6.de; +Cc: pgsql-general



On Thu, 10 Jan 2008, mljv@planwerk6.de wrote:

> ah! So it doesn't help if it's the same statement, it has to be the same
> object! So DBCP has a statement pool like a map, say
> Map<String, PreparedStatement>
> so it can fetch the reference to already existing prepared Statement by
> looking at the statement itself, right?

Exactly.

> But JDBC itself uses the "PREPARE" sql command, right?
> So the statement is not really unnamed its name is "<unnamed>" like
> prepare "<unnamed>" as select * from table;
> execute "<unnamed>";
>
> But i can't see any DEALLOCATE statements in my log file.

The JDBC driver does not use SQL level PREPARE / DEALLOCATE calls, but 
instead uses protocol level commands that are pretty much equivalent. 
The logging process tries to log sql and protocol level commands the same 
way which is why it shows up that way in the log.  Perhaps the server 
should log the protocol level deallocate as well?

> What do you mean with "longer lifespan"? Doesn't the JDBC driver uses the
> PREPARE Sql Statement and therefore the prepared Statement has the same
> lifespan as the connection? If so, as connections are pooled and never
> closed, the prepared Statement will last forever. What if the table analyzes
> changes and a better execution plan could be found?
>

Data and stats changes do not trigger a replan.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2008-01-12 23:46  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Tom Lane @ 2008-01-12 23:46 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: mljv@planwerk6.de; pgsql-general

Kris Jurka <books@ejurka.com> writes:
> On Thu, 10 Jan 2008, mljv@planwerk6.de wrote:
>> What do you mean with "longer lifespan"? Doesn't the JDBC driver uses the
>> PREPARE Sql Statement and therefore the prepared Statement has the same
>> lifespan as the connection? If so, as connections are pooled and never
>> closed, the prepared Statement will last forever. What if the table analyzes
>> changes and a better execution plan could be found?

> Data and stats changes do not trigger a replan.

Note that this is no longer true as of 8.3: a stats update from ANALYZE
(either manual or autovacuum) will trigger invalidation of cached plans.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared Statements
@ 2008-01-13 11:13  Janning Vygen <vygen@planwerk6.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 19+ messages in thread

From: Janning Vygen @ 2008-01-13 11:13 UTC (permalink / raw)
  To: pgsql-general

Am Sonntag 13 Januar 2008 00:46:50 schrieb Tom Lane:
> Kris Jurka <books@ejurka.com> writes:
> > On Thu, 10 Jan 2008, mljv@planwerk6.de wrote:
> >> What do you mean with "longer lifespan"? Doesn't the JDBC driver uses
> >> the PREPARE Sql Statement and therefore the prepared Statement has the
> >> same lifespan as the connection? If so, as connections are pooled and
> >> never closed, the prepared Statement will last forever. What if the
> >> table analyzes changes and a better execution plan could be found?
> >
> > Data and stats changes do not trigger a replan.
>
> Note that this is no longer true as of 8.3: a stats update from ANALYZE
> (either manual or autovacuum) will trigger invalidation of cached plans.

great, i have too look out for 8.3, but i am quite happy with 8.1 because of 
automatic security updates coming with debian out of the box. I have to look 
for another way to replan. Maybe i just have to close and reopen my 
connections from time to time.

kind regards
Janning




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* prepared statements
@ 2010-07-23 18:27  Scott Frankel <frankel@circlesfx.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Scott Frankel @ 2010-07-23 18:27 UTC (permalink / raw)
  To: pgsql-general


Hi all,

I'm working with prepared statements directly in pg for the first time  
and have a couple of questions.

Does a prepared statement used to insert into a table need to insert  
into all columns of the table? I've found that, for a table with a  
serial sequence key as its first column, I have to specify the key in  
my prepared statement or I get type errors:  ERROR:  column "foo_id"  
is of type integer but expression is of type character varying.

What's the best way to specify the next value for the serial sequence  
key if subqueries are not allowed in a prepared statement's execute  
parameter:  ERROR:  cannot use subquery in EXECUTE parameter

For example, given the following table definition:
CREATE TABLE foo (
	foo_id				SERIAL		PRIMARY KEY,
	name				VARCHAR(32)	UNIQUE NOT NULL,
	description			TEXT,
	body				TEXT		DEFAULT NULL,
	created				timestamp	DEFAULT CURRENT_TIMESTAMP,
	UNIQUE				(name));

What's the best way to insert several records that have lots of  
special characters in the "body" column?  eg:

PREPARE fooprep (int, VARCHAR(32), text, text) AS
     INSERT INTO foo VALUES ($1, $2, $3, $4);
EXECUTE (fooprep
(SELECT nextval('foo_id_seq')),
'foo1',
'this is foo1',
'#!()[]{}
qwepoiasdlkjzxcmnb
/\1\2\3\4\5\6\7\8\9/');

Thanks in advance!
Scott






^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: prepared statements
@ 2010-07-23 21:53  Daniel Verite <daniel@manitou-mail.org>
  parent: Scott Frankel <frankel@circlesfx.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Daniel Verite @ 2010-07-23 21:53 UTC (permalink / raw)
  To: Scott Frankel <frankel@circlesfx.com>; +Cc: pgsql-general

	Scott Frankel wrote:

> I've found that, for a table with a  
> serial sequence key as its first column, I have to specify the key in  
> my prepared statement or I get type errors:  ERROR:  column "foo_id"  
> is of type integer but expression is of type character varying.

Let's try:

test=> create table t(a serial, b int);
NOTICE:  CREATE TABLE will create implicit sequence "t_a_seq" for serial
column "t.a"
CREATE TABLE
test=> prepare a as insert into t(b) values($1);
PREPARE
test=> execute a(2);
INSERT 0 1
test=> select * from t;
 a | b 
---+---
 1 | 2
(1 row)

No error here...

Best regards,
-- 
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: prepared statements
@ 2010-07-23 23:32  Scott Frankel <frankel@circlesfx.com>
  parent: Daniel Verite <daniel@manitou-mail.org>
  0 siblings, 1 reply; 19+ messages in thread

From: Scott Frankel @ 2010-07-23 23:32 UTC (permalink / raw)
  To: Daniel Verite <daniel@manitou-mail.org>; +Cc: pgsql-general


Works!  The bug in my example was not passing the INSERT statement an  
explicit list of column names, as per any non-prepared insert.

Thanks!
Scott


On Jul 23, 2010, at 2:53 PM, Daniel Verite wrote:

> 	Scott Frankel wrote:
>
>> I've found that, for a table with a
>> serial sequence key as its first column, I have to specify the key in
>> my prepared statement or I get type errors:  ERROR:  column "foo_id"
>> is of type integer but expression is of type character varying.
>
> Let's try:
>
> test=> create table t(a serial, b int);
> NOTICE:  CREATE TABLE will create implicit sequence "t_a_seq" for  
> serial
> column "t.a"
> CREATE TABLE
> test=> prepare a as insert into t(b) values($1);
> PREPARE
> test=> execute a(2);
> INSERT 0 1
> test=> select * from t;
> a | b
> ---+---
> 1 | 2
> (1 row)
>
> No error here...
>
> Best regards,
> -- 
> Daniel
> PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org
>
> -- 
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: prepared statements
@ 2010-07-24 11:01  Alban Hertroys <dalroi@solfertje.student.utwente.nl>
  parent: Scott Frankel <frankel@circlesfx.com>
  0 siblings, 0 replies; 19+ messages in thread

From: Alban Hertroys @ 2010-07-24 11:01 UTC (permalink / raw)
  To: Scott Frankel <frankel@circlesfx.com>; +Cc: Daniel Verite <daniel@manitou-mail.org>; pgsql-general

On 24 Jul 2010, at 1:32, Scott Frankel wrote:

> Works!  The bug in my example was not passing the INSERT statement an explicit list of column names, as per any non-prepared insert.


You would have needed it for an unprepared statement just as well in this case. You expect the planner to guess which columns you left out? ;)

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4c4ac805286212004583493!





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Prepared statements
@ 2018-03-21 21:09  Tim Cross <theophilusx@gmail.com>
  0 siblings, 2 replies; 19+ messages in thread

From: Tim Cross @ 2018-03-21 21:09 UTC (permalink / raw)
  To: pgsql-general


a simple question I wasn't able to get a clear answer on....

It is general best practice to use prepared statements and parameters
rather than concatenated strings to build sql statements as mitigation
against SQL injection. However, in some databases I've used, there is
also a performance advantage. For example, the planner may be able to
more easily recognise a statement and reuse an existing plan rather than
re-planning the query.

I wasn't sure what the situation is with postgres - is there a
performance benefit in using prepared statements over a query string
where the values are just concatenated into the string?

thanks,

Tim

--
Tim Cross




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared statements
@ 2018-03-21 21:16  Rakesh Kumar <rakeshkumar464@aol.com>
  parent: Tim Cross <theophilusx@gmail.com>
  1 sibling, 1 reply; 19+ messages in thread

From: Rakesh Kumar @ 2018-03-21 21:16 UTC (permalink / raw)
  To: theophilusx@gmail.com; pgsql-general

> For example, the planner may be able to
> more easily recognise a statement and reuse an existing plan rather than
> re-planning the query.

This is a double edged sword.  Reuse an existing plan can be bad in those
cases where the data distribution is not suitable for the current plan. This has
been the achilles heel of many RDBMS.  Only in Oracle 12c there are 
options to let the planner change existing plan by peeking into the parameter
values (supplied in ? of prepare) and checking it against the distribution.




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared statements
@ 2018-03-21 21:32  Steve Atkins <steve@blighty.com>
  parent: Tim Cross <theophilusx@gmail.com>
  1 sibling, 0 replies; 19+ messages in thread

From: Steve Atkins @ 2018-03-21 21:32 UTC (permalink / raw)
  To: pgsql-general


> On Mar 21, 2018, at 2:09 PM, Tim Cross <theophilusx@gmail.com> wrote:
> 
> 
> a simple question I wasn't able to get a clear answer on....
> 
> It is general best practice to use prepared statements and parameters
> rather than concatenated strings to build sql statements as mitigation
> against SQL injection. However, in some databases I've used, there is
> also a performance advantage. For example, the planner may be able to
> more easily recognise a statement and reuse an existing plan rather than
> re-planning the query.
> 
> I wasn't sure what the situation is with postgres - is there a
> performance benefit in using prepared statements over a query string
> where the values are just concatenated into the string?

There are two separate things.

Parameterized queries are a query made by your code such that
the values are passed in alongside SQL that has placeholders
such as $1, $2, ... They're what help save you from SQL injection.

A prepared statement is a reference to a query that has previously
been passed to the database, and likely pre-interpreted and planned,
that's ready to accept parameters and run.

Using a prepared statement saves the planner from having to decide
on a plan to run the query, which saves you planning time. But it
does that by preparing a generic plan that'll work for any bound
parameter. The planner might be able to come up with a specific
plan based on the particular values passed in that is better than
the generic plan, so a naive implementation of prepared statements
might lead to the execution of the query being slower in some cases,
as it uses a generic plan when a specific one might be better.

Postgresql avoids the worst cases of that by only switching to a
generic plan for a prepared statement after it's re-planned it
a few times with specific values, and the specific plans have
been costed more expensive than the generic one (or something
like that).

The generic plan is also frozen in to the prepared statement, so
if the data statistics vary significantly during the lifetime of the
prepared statement the plan may no longer be a particularly
good one.

Prepared statements are certainly useful, but choosing whether
to use them or not isn't quite as simple as "it'll avoid the planning
overhead".

Parameterized queries are almost always a good idea.

Cheers,
  Steve





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared statements
@ 2018-03-22 08:33  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Rakesh Kumar <rakeshkumar464@aol.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Laurenz Albe @ 2018-03-22 08:33 UTC (permalink / raw)
  To: Rakesh Kumar <rakeshkumar464@aol.com>; theophilusx@gmail.com; pgsql-general

Rakesh Kumar wrote:
> Only in Oracle 12c there are 
> options to let the planner change existing plan by peeking into the parameter
> values (supplied in ? of prepare) and checking it against the distribution.

You mean Oracle 11g.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Prepared statements
@ 2018-03-22 11:02  Rakesh Kumar <rakeshkumar464@aol.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 19+ messages in thread

From: Rakesh Kumar @ 2018-03-22 11:02 UTC (permalink / raw)
  To: laurenz.albe@cybertec.at; theophilusx@gmail.com; pgsql-general


> You mean Oracle 11g.

No 12c.  Some of it may have started in 11g itself, but only in 12c they really mastered it.  I saw it as a developer, not as a DBA. I was never an oracle DBA.




^ permalink  raw  reply  [nested|flat] 19+ messages in thread


end of thread, other threads:[~2018-03-22 11:02 UTC | newest]

Thread overview: 19+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-22 17:37 Prepared Statements Eric Dahnke <edahnke@nyc.yamaha.com>
2003-10-22 21:54 ` Peter Eisentraut <peter_e@gmx.net>
2008-01-09 19:02 Prepared Statements mljv@planwerk6.de
2008-01-09 19:50 ` Martin Gainty <mgainty@hotmail.com>
2008-01-09 20:16 ` Kris Jurka <books@ejurka.com>
2008-01-10 10:53   ` mljv@planwerk6.de
2008-01-10 12:12     ` Isak Hansen <isak.hansen@gmail.com>
2008-01-12 22:04     ` Kris Jurka <books@ejurka.com>
2008-01-12 23:46       ` Tom Lane <tgl@sss.pgh.pa.us>
2008-01-13 11:13         ` Janning Vygen <vygen@planwerk6.de>
2010-07-23 18:27 prepared statements Scott Frankel <frankel@circlesfx.com>
2010-07-23 21:53 ` Re: prepared statements Daniel Verite <daniel@manitou-mail.org>
2010-07-23 23:32   ` Re: prepared statements Scott Frankel <frankel@circlesfx.com>
2010-07-24 11:01     ` Re: prepared statements Alban Hertroys <dalroi@solfertje.student.utwente.nl>
2018-03-21 21:09 Prepared statements Tim Cross <theophilusx@gmail.com>
2018-03-21 21:16 ` Re: Prepared statements Rakesh Kumar <rakeshkumar464@aol.com>
2018-03-22 08:33   ` Re: Prepared statements Laurenz Albe <laurenz.albe@cybertec.at>
2018-03-22 11:02     ` Re: Prepared statements Rakesh Kumar <rakeshkumar464@aol.com>
2018-03-21 21:32 ` Re: Prepared statements Steve Atkins <steve@blighty.com>

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