John Siracusa wrote:
> Finally, if you only want to turn this on for particular calls, remember
> that the db is an optional argument to all Manager methods.  You can always
> make/get a $db, yank out the $dbh, set the attribute manually, and pass the
> $db as a parameter to your Manager calls.
> 
>     $db = My::DB->new(...);
>     $db->dbh->{'mysql_use_result'} = 1;
>     $iterator = MalwareLog::Manager->get_blah_iterator(db => db, ...);

I recommend doing it this way, and turning it off after your large 
query, unless this is essentially a single user reporting database. 
When you turn on mysql_use_result and do a query on a MyISAM table, it 
will keep a read lock on the table until you finish with that statement 
handle.  This is not an issue with InnoDB tables because they use 
multi-version concurrency control (MVCC), so readers never block writers.

If all you use it for is reports, and you don't need to handle 
concurrent updates, then it doesn't matter and you can just leave it on 
all the time.

- Perrin

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to