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. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>