Re: Puzzling "Costly type conversion" warnings
Posted by: Mark Matthews
Date: June 13, 2005 06:50AM

Craig Carper wrote:
> Mark Matthews wrote:
>
> ...
> > Nope. Not true. You can only have one open
> result
> > set per statement, but you can have as many
> open
> > statements on a connection as you need.
>
> Thanks for pointing out that multiple statements
> can co-exist on a connection. Habits can turn into
> false assumptions.
>
> Still, its not obvious how to use prepared
> statements to improve performance in a web
> application that grabs a connection for each
> request and isn't likely to execute the same
> statement twice in handling a single request.
> Seems a shame that a new connection can't benefit
> from an identical prepared statement on an earlier
> connection.


Craig,

In general, most (if not all) databases don't really allow you to fully "share" a prepared statement across connections. What you can do is use a connection pool that pools _statements_ though. Most "modern" ones have this functionality. In that way, the prepared statement that is pooled lives at least as long as the connection does, and can be reused multiple times by the application.

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
Re: Puzzling "Costly type conversion" warnings
June 13, 2005 06:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.