Re: Preformance - Mailing list pgsql-general

From Tom Lane
Subject Re: Preformance
Date
Msg-id 19030.1012687798@sss.pgh.pa.us
Whole thread Raw
In response to Re: Preformance  (Cees van de Griend <cees-list@griend.xs4all.nl>)
Responses Re: Preformance
List pgsql-general
Cees van de Griend <cees-list@griend.xs4all.nl> writes:
> What can possible be the cause of the difference in preformance?

Probably the VACUUM ANALYZE statistics changed just enough to push the
planner into making the wrong choice.  You could experiment with doing
"set enable_nestloop to off" and then EXPLAIN to see what the plan and
cost are; I'll bet that the estimated cost of the hash plan is now
just fractionally more than that of the nestloop.

Of course, the *true* costs are very different, which is why I consider
this a planner estimation failure.

> Is is as simple as a wrong choice of the planner and can a wrong choice
> have such huge effect?

Yes, and yes.

            regards, tom lane

pgsql-general by date:

Previous
From: Cees van de Griend
Date:
Subject: Re: Preformance
Next
From: "Jeff Martin"
Date:
Subject: Re: PostgreSQL transaction locking problem