2025-05-19 23:23:58 "Laurenz Albe" <laurenz(dot)albe(at)cybertec(dot)at> wrote:
>
> I see no bug here.
> The join condition is so complicated that the planner has a hard
> time estimating the number of result rows for the join.
> It guesses way to low, so the sort is expensive, and avoiding it is cheaper.
>
> The optimizer cannot be perfect, particularly in the face of complicated
> expressions like that.
>
> Yours,
> Laurenz Albe
Thank you for your answer! In the future I will avoid performance issues due to under-optimization of the optimizer.
regards,
hongjun xiao