from_collapse_limit vs. geqo_threshold - Mailing list pgsql-hackers

From Robert Haas
Subject from_collapse_limit vs. geqo_threshold
Date
Msg-id 603c8f070905202040v66cd3054t434c0b73aa844c63@mail.gmail.com
Whole thread Raw
Responses Re: from_collapse_limit vs. geqo_threshold
List pgsql-hackers
The docs contain the following sage advice concerning from_collapse_limit:

"It is usually wise to keep this less than geqo_threshold."

I've been thinking through this advice on and off for about 2 years
and I still don't understand it.  The point of either
from_collapse_limit and geqo_threshold is to avoid exponential growth
in planning time when planning large join nests.  Either of them has
the effect of reducing planning time at the expense of possibly
getting an inferior plan.  However, it's my experience that the plans
that result when the from_collapse_limit kicks in are almost
invariably terrible when fetching only a small number of rows.  On the
other hand, the few GEQO plans I've had experience with have been
pretty reasonable.

It appears that this statement has been in our documentation since Tom
Lane added FROM_COLLAPSE_LIMIT (back then, it was capitalized) on
January 25, 2003 (9bf97ff426de9), but I can't find any justification
for it anywhere.  I think we either need to justify this advice, or
remove it.

...Robert


pgsql-hackers by date:

Previous
From: Adriano Lange
Date:
Subject: Re: GEQO: ERX
Next
From: "Fly.Li"
Date:
Subject: How to issure PQexec is thread safety if use a connceion in two threads?