Simple DELETE FROM performance enhancement

JAB Creations's profile image JAB Creations posted 4 weeks ago in General Permalink

This is simply a suggestion for a DELETE FROM performance enhancement.

Generally speaking you could do id ranges (presuming there are ids, I don't work with wonky databases). That being said someone might Control-click and create "broken ranges" so-to-speak.

However there is another option that negates the "broken range" issue: IN():

DELETE FROM table_name WHERE id IN('1','2','4','107');

So instead of having a DELETE FROM query for every single row being deleted HeidiSQL could just execute a single query. That, at least for what I do would improve performance though I'm not sure what use cases might nullify that (deleting 900 rows?) so I'm not suggesting blindly implement it though certainly please consider it. And again I don't work with wonky databases so I have no idea how HeidiSQL handles deleting rows from a table that does not have any id / primary key defined.

Please login to leave a reply, or register at first.