MySQL Forums
Forum List  »  Perl

Re: How to use Query Cache with Perl DBI
Posted by: Bill Karwin
Date: September 03, 2006 12:21AM

It looks like DBI does call prepare() for all queries.

From DBI.pm:
    sub selectall_arrayref {
	my ($dbh, $stmt, $attr, @bind) = @_;
	my $sth = (ref $stmt) ? $stmt : $dbh->prepare($stmt, $attr)
	    or return;
	$sth->execute(@bind) || return;
    . . .

And similarly for other methods, even do().

So aside from prepare_cached(), it looks like there is no query result caching optimization. And using prepare_cached() may not be the right thing to do. I don't know if it can know when the cache gets busted, like the server-side query cache does.

Regards,
Bill K.

Options: ReplyQuote


Subject
Written By
Posted
September 01, 2006 10:20AM
Re: How to use Query Cache with Perl DBI
September 03, 2006 12:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.