-- Mark Stosberg <[EMAIL PROTECTED]>

Hello,

I have a database application that selects about 50,000 rows one by one,
does some process in Perl, and then executes a SELECT statement for each
one, with slight variations in the SQL and parameters.

I was using prepare_cached() on this repeatedly called SELECT statement.

Depends on how you're using the caching.

If it looks something like:

   my $sth =
       prepare_cached( 'select foo from bar where ( bletch = ?)' );

Then this should generate a single "query" and re-cycle it for
later use. If you are using ANYthing hardcoded specific to the
query then caching will just leave a huge number of row-specific
queries lying around; which is probably not what you want.

Q: Are the placeholders in the existing query(s) or do they use
  hard-coded values?

If you have a small number of placeholder queries then this
is odd behavior; if not then all you've done is generate the
non-recycled-cache-from-hell and the behavior is normal.

--
Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
[EMAIL PROTECTED]                                     1 888 359 3508

Reply via email to