Performance gain when not using prepared statements?
| From: | Vitalii Demianets | Date: | Fri, 17 Jun 2011 08:55:46 +0000 |
| Subject: | Performance gain when not using prepared statements? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-313586@lists.php.net to get a copy of this message | ||
On Friday 17 June 2011 04:50:00 Daevid Vincent wrote:
> > I've seen too many people over the years try and rally against common
> > sense practices like using prepared statements for perhaps a marginal
> > gain of performance on one page while their load averages are 0,0,0.
>
> Agreed. The ONLY time prepared statements are useful, is in a loop where
> you're changing a few variables but within the same SQL statement. That is
> a rare case for most people.
>
Not ONLY. I love prepared statements because with them I can store arbitrary
strings in DB without need to worry about fancy escaping and SQL injection.
And do it in DB-independent way.
Think about all that extra escaping and performance gain of not using prepared
statement will shrink a lot ) Don't have actual numbers though.
--
Vitalii