in reply to Deleting Multiple MySQL Rows With DBI
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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Deleting Multiple MySQL Rows With DBI
by runrig (Abbot) on May 22, 2001 at 23:43 UTC | |
by lhoward (Vicar) on May 23, 2001 at 00:15 UTC | |
|
Thank you guys so much
by Red Neckerson (Novice) on May 23, 2001 at 03:42 UTC |