On Tue, 3 Dec 2002, Joseph Shraibman wrote:
> Joseph Shraibman wrote:
> > Since postgres
> > seems to think that the nested loop takes so long do I have to lower
> > cpu_operator_cost to get postgres to use the nested loop?
>
> To answer my own question that doesn't work. I've kept playing around with different
> paramaters with different variables but I can't find anything except disabling seqscans.
>
> This is really annoying, because *all* of my queries suddenly slowed down at the same
> time. What can I do? Is there something I can change in the source to have nested loops
> seem cheaper? I haven't found anything.
Have you tried lowering random page cost?
I've often found that I need to set it to somewhere from 0.5 to 2.0 to get
a sane response from the planner on some queries.
Of course, I'm assuming you've analyzed your data, and that the guesses
the analyzer made were close to correct (i.e. number of rows estimated for
a query and the number actually returned are pretty close to each other.)