John Day [[EMAIL PROTECTED]] wrote:
> I would like to rewrite an application using DBI, DBD and mySQL so that I can 
>prepare a several statements once using placeholders and then execute them within a 
>loop without re-preparing them.
> 
> Basically for each of about 2,000 clients I have to read up to 750,000 records, 
>modify each one and write it back. I would like to improve efficiency by not having 
>to prepare the statement each time (as the version I am rewriting does).
> 
> Will this work?

I don't see why not - that's how I'd do it.  Try it, and if you
have problems, post back here.  I think you're going to see a BIG
performance gain.

You probably already know this - small but significant thing if
you're not an experience DBI person - be sure to use a different
statement handle for each statement that you are preparing before
the loop.

-- 
Hardy Merrill
Senior Software Engineer
Red Hat, Inc.

Reply via email to