Re: [GENERAL] Planner tuning

2007-03-20 Thread Alban Hertroys
Dmitry Koterov wrote: > I don't know exactly is it your case, but sometimes > > SET enable_sort = off; > > speeds up some queries by the factor of hundred. But in some cases this > command slows down operations, so I TEMPORARILY switch enable_sort on and > off for some queries. It affects the que

Re: [GENERAL] Planner tuning

2007-03-20 Thread Dmitry Koterov
I don't know exactly is it your case, but sometimes SET enable_sort = off; speeds up some queries by the factor of hundred. But in some cases this command slows down operations, so I TEMPORARILY switch enable_sort on and off for some queries. It affects the query plan greatly. On 3/20/07, Alban

Re: [GENERAL] Planner tuning

2007-03-20 Thread Alban Hertroys
Tom Lane wrote: > Alban Hertroys <[EMAIL PROTECTED]> writes: >> It seems pretty obvious that the planner underestimates the cost of >> nestloops here, is there some way to tweak this? > > The real problem is the factor-of-a-thousand underestimate of the size > of this join: Good observation, I mi

Re: [GENERAL] Planner tuning

2007-03-19 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > It seems pretty obvious that the planner underestimates the cost of > nestloops here, is there some way to tweak this? The real problem is the factor-of-a-thousand underestimate of the size of this join: >-> Nested Loop (cost=0.00..281.74 rows=2

Re: [GENERAL] Planner tuning

2007-03-19 Thread Alban Hertroys
Alban Hertroys wrote: > I have a query here for which postgres chooses a nested loop, for which > it takes ~19s to complete in the worst-case (measured). However, if I > disable nestloops it completes in ~400ms... > > It seems pretty obvious that the planner underestimates the cost of > nestloops

[GENERAL] Planner tuning

2007-03-19 Thread Alban Hertroys
I have a query here for which postgres chooses a nested loop, for which it takes ~19s to complete in the worst-case (measured). However, if I disable nestloops it completes in ~400ms... It seems pretty obvious that the planner underestimates the cost of nestloops here, is there some way to tweak t