Fwd: Re: Endless loop in ExecNestLoop - Mailing list pgsql-bugs

From Philipp Reisner
Subject Fwd: Re: Endless loop in ExecNestLoop
Date
Msg-id 200601311647.30677.philipp.reisner@linbit.com
Whole thread Raw
In response to Re: Endless loop in ExecNestLoop  (Philipp Reisner <philipp.reisner@linbit.com>)
List pgsql-bugs
----------  Weitergeleitete Nachricht  ----------

Subject: Re: [BUGS] Endless loop in ExecNestLoop
Date: Dienstag, 31. Januar 2006 16:39
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Philipp Reisner <philipp.reisner@linbit.com>
Cc: pgsql-bugs@postgresql.org

Philipp Reisner <philipp.reisner@linbit.com> writes:
> Well after more research it turned out that sometimes we have a plan
> that executes in less than 2 seconds, and somethimes we get a plan
> does not terminate within 1h30 of CPU time.

Could you send EXPLAIN ANALYZE output for this (at least for the fast
case)?  Presumably some of the planner's estimates are way off, but
there's no way to know which ones from just EXPLAIN.

>> What reasons are there for the planer to choose a different plan ?

It looks to me like the statistics have changed, because it's showing

different rowcount and width estimates for the same scan:
>                                        ->  Index Scan using
> contractelements_pkey on contractelements cel  (cost=3D0.00..5574.21 rows=
=3D459
> width=3D22) Filter: (upper((isactiv)::text) =3D 'Y'::text)
>
>                                        ->  Seq Scan on contractelements c=
el
>  (cost=3D0.00..4253.10 rows=3D387 width=3D21) Filter: (upper((isactiv)::t=
ext) =3D
> 'Y'::text)

Perhaps you ran VACUUM or ANALYZE in between, or autovacuum did so for
you?

            regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

-------------------------------------------------------

--=20
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Sch=C3=B6nbrunnerstr 244, 1120 Vienna, Austria    http://www.linbit.com :

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Endless loop in ExecNestLoop
Next
From: Clifford Wolf
Date:
Subject: Bug in query planer ?