RE: stored procedure vs. prepared statement
Posted in 2000
The first step I would probably take for both performance and reliability is upgrade.... Prepared statements can be used when a program executes a given statement multiple times during one given connection. This way the query plan for this action is only generated once. To be honest, I tend to stay away from stored procedures due to religious reasons. I have found them useful on occasion, but have never really explored their use for a performance benefit. They probably can provide a large performance benefit if you can cut down a large amount of data transfer from the database to the client by using them. Hope this helps, Will >===== Original Message From "Kevin Macclay" <kmacclay@vantage.com> ===== >We're running INFORMIX-OnLine Version 7.12.UC1. > >We're using Informix as a back-end to our web site and wish to improve performance between our code and the database. We're currently using Statement objects to perform all queries. I have read, however, that it is smarter to use PreparedStatements which can be compiled once and >re-used without the database having to recompile/re-evaluate the statement. Does it make sense to use a PreparedStatement for every SQL statement we're executing (they're all very basic queries, updates, and inserts -- nothing too fancy). I've also read about Stored Procedures >however, and this has confused me a great deal! When is it correct to use a PreparedStatement and when is it best to use a Stored Procedure? I read somewhere that Stored Procedures aren't necessarily a performance boost and are mostly used to encapsulate a few queries that logically >fit together. Is this correct? Does it make sense to implement Stored Procedures to improve performance with Informix? > >Any help or insight is greatly appreciated! Thanks in advance. > >Kevin MacClay ------------------------------------------------------------ This e-mail has been sent to you courtesy of OperaMail, as a free service from Opera Software, makers of the award-winning Web Browser, Opera. Visit us at http://www.opera.com/ or our portal at: http://www.myopera.com/ Your free e-mail account is waiting at: http://www.operamail.com/ ------------------------------------------------------------