=?iso-8859-2?Q?Artur_Zaj=B1c?= <azajac(at)ang(dot)com(dot)pl> writes:
> I've changed default_statistics_target to 10000 and I think that is a
> reason.
That's certainly going to cost you something, but this seems like a
mighty large slowdown, especially for a non-join query. What datatype
is te.idtr, anyway?
regards, tom lane