3 ms·
Came here to say exactly that! I do a select count and then a limit against the returned count. At least it may reduce the blast radius.
by gumballindie 3y ago
Came here to say exactly that! I do a select count and then a limit against the returned count. At least it may reduce the blast radius.
- sgarland 3y agoThis can also bite you if your dataset is larger than the buffer pool (or whatever other RDBMS calls it), and the particular table you’re querying isn’t commonly accessed. Turns out when you start loading millions of rows of useless data into memory, the useful data has to get kicked out, and that makes query latency skyrocket.
- menacingly 3y agoIn most of my scenarios, I'd actually rather cause a catastrophic global change than a silent subtle corruption of a handful of rows
- gumballindie 3y agoThat may be fun in a trivial setup such as op’s but when millions of customers or billions of transactions are affected it’s a nightmare. A competent engineer runs queries against a local and then a uat db, verifies results and then on prod. But if you must do it in prod then it must be limited in scope.
- menacingly 3y agoWe're on the same page with the best approach, I just don't consider corrupting an unpredictable subset of my database much of an improvement. It's not closer to correct, it's just still incorrect.