MySQL Prepared Statements vs Stored Procedures Performance
Posted
by amardilo
on Stack Overflow
See other posts from Stack Overflow
or by amardilo
Published on 2009-10-05T11:00:14Z
Indexed on
2010/05/27
16:51 UTC
Read the original article
Hit count: 219
Hi there,
I have an old MySQL 4.1 database with a table that has a few millions rows and an old Java application that connects to this database and returns several thousand rows from this this table on a frequent basis via a simple SQL query (i.e. SELECT * FROM people WHERE first_name = 'Bob'
. I think the Java application uses client side prepared statements but was looking at switching this to the server, and in the example mentioned the value for first_name will vary depending on what the user enters).
I would like to speed up performance on the select query and was wondering if I should switch to Prepared Statements or Stored Procedures. Is there a general rule of thumb of what is quicker/less resource intensive (or if a combination of both is better)
© Stack Overflow or respective owner