> Yay! You're right! I wonder why have I forgotten about LANGUAGE SQL. :)
> It's 30 seconds vs 5 seconds for CASE ... END insisde PLpgsql vs CASE...END
> LANGUAGE SQL. :) I.e. its almost the same as in-place entered SQL.
>
> Regards,
> Dawid
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match