FAQ

On Fri, 17 Jun 2005 18:15:13 -0600, Siegfried Heintze wrote:
Does MySQL/DBI really parse SQL statements in advance? I've been using
mostly interpolated SQL statements in my screen scraping bot that is
implemented with multiple threads and HTML::Parser. As you might now,
HTML::Parser calls your code and you have to figure out how to save
statement in between calls.

I have gazillions of SQL statements and the thought of allocating thread
safe storage for all of them and initializing the properly before using them
seems intimidating. That is an awful lot of thread statement I need to keep
track of.

Would it make my program run faster if I just called prepare once for each
SQL statement in each thread? That would require MySQL to be pretty
sophisticated. What about PostGreSQL?
Try the prepare_cached method.

Also, make sure you are using placeholders in your SQL. Then it would
be *really* unusual to have zillions of SQL statements in an application.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedJun 18, '05 at 12:48p
activeJun 18, '05 at 12:48p
posts1
users1
websiteperl.org

1 user in discussion

Peter Scott: 1 post

People

Translate

site design / logo © 2021 Grokbase