3 ms·
I always liked LIMIT when doing dangerous stuff in prod
by davio 4y ago
I always liked LIMIT when doing dangerous stuff in prod
- progman32 4y agoFor anyone doing this, just keep in mind that chucking on a LIMIT 1 can give you a false sense of security. For example, say you want to drop a single row but forget the WHERE. A LIMIT 1 will return "yep, deleted one row" but it's not the one you wanted (instead, it's whatever row came up first). Better to do the operation in a transaction that you can rollback - that way, you can better validate the results of your operation before committing.