π
article
rubyflow.com
·
October 7, 2026
Don't bet on SELECT's order: shuffle your rows and see what folds
SELECT * FROM posts carries no promise about the order of the returned posts. Yet, every relational database hands them back in some order, and code and tests start depending on that order. You canβt grep for a bug like this, but you can smoke it out by deliberately shuffling the rows of every unordered query and seeing what fails. (Rails has since merged a switch of its own from Evil Martians, config.active_record.shuffle_unordered_selects, due in 8.2.) We also share pg_disorder, the open-so...
Read on rubyflow.com →