Rows are sorted by a random value
What it finds
ORDER BY RANDOM() or ORDER BY NEWID() computes a random value for every row and sorts them all to pick a few, which grows with the table. Sampling (TABLESAMPLE) or a random key range avoids the full sort.
From the rule's source, random_order.rs.
Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/sql:random-order" = "warning"To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.
tx0 explain tx0/sql:random-order shows the same in the terminal. Found a false positive? Report it.