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 @
postedJun 18, '05 at 12:48p
activeJun 18, '05 at 12:48p

1 user in discussion

Peter Scott: 1 post



site design / logo © 2021 Grokbase