Since the query is always the same, you only need to prepare it once. I suspect that doing it in one query whith an "or" or "in" using the entire list of numbers at once (depending on how many you're deleting) may not be well optomized by the server, and hence slower.my $sth = $dbh->prepare("DELETE FROM table WHERE message_id = ?"); foreach $i (@MESSAGE_IDS){ $sth->execute($i); }
In reply to Re: Deleting Multiple MySQL Rows With DBI
by lhoward
in thread Deleting Multiple MySQL Rows With DBI
by Red Neckerson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |