Delete set of rows from data table more efficiently

There are times when you need to delete a set of rows from a data table. Current practice is to query the data table to get a search iterator for that set of rows, and then iterate over it deleting each row individually. For large results that can cause an appreciable delay.

Databases are good at deleting large numbers of rows directly. It’d be nice if search iterators (and possibly client writeable views?) had a delete_all_rows method that deleted only the rows contained in that iterator or view. That way the rows could be deleted more efficiently than iterating over them.

There’d need to be some concern for security. I’d personally be fine if delete_all_rows on iterators and views only worked on the server side.

Here are some past threads where this feature would have been the solution:

13 Likes