Tom Lane wrote:
>
> The choices made by GEQO are intentionally random, so I would expect
> variation in tuple output order even for repetitions of the identical
> query. If you got a semantically different result, that would indeed
> be a bug. But it would most likely be a bug in the core planner, since
> GEQO has essentially no influence over whether the produced plan is
> correct or not. GEQO merely forces specific choices of join order.
> All else is in the core planner.
You can remove the randomness by setting the Seed configuration value, if
the docs are correct.
Regards,
Ed Loehr