|
|
|
|
|
by porridgeraisin
406 days ago
|
|
It doesn't matter. The output of a query cannot depend on the plan. All plans should generate semantically equivalent output necessarily. Notice I say semantically equivalent because obviously
Select random() can return different numbers each time. But it should still be semantically, one single random number. In this case, the number of rows changing given the same input dataset, is a bug. |
|
E.g., for a very simple case, in SELECT * FROM a,b WHERE random() < 0.5, would you push random() down through the join or not? To one table? Both tables? Evaluate it once at the start of a query because it depends on neither a nor b? What if it's random() < a.x? Different databases have different and often poorly-defined semantics here.