in reply to Re: Re: Deleting Multiple MySQL Rows With DBI
in thread Deleting Multiple MySQL Rows With DBI

In general DB servers aren't good at optomizing "in" or "or" queries. The server may end up doing a table scan to locate all the items to delete, which could be really slow. By doing each ID individualy you're guaranteed that each one will go directly to that item (assuming there's an index on the ID col) and delete it. True you are executing more statments, but I suspect that in many situations it could be quicker than the poorly optomized "in" statment.

Benchmarks would be interesting ;)

  • Comment on Re: Re: Re: Deleting Multiple MySQL Rows With DBI