Re: RE : RE : BUG #3519: Postgres takes the wrong query plan resulting in performance issues

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, "Mouhamadou Dia" <MDia(at)accovia(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: RE : RE : BUG #3519: Postgres takes the wrong query plan resulting in performance issues
Date: 2007-08-07 01:30:53
Message-ID: 6999.1186450253@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> The structure of your query is a whole series of left outer joins, the result
> of which is then (inner) joined with one more table. The outer joins return a
> whole lot of records but the inner join is only going to match a few of them.

Hmmm ... actually I see 6 tables inside the join-tree and four more
loose in the FROM-clause, ten relations altogether. Which means the OP
is falling foul of from_collapse_limit, and it's not investigating every
possible join order. Try setting from_collapse_limit to more than 10.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Brodie Thiesfield 2007-08-07 03:41:07 BUG #3520: insert causing error "invalid memory alloc request size 2147483648"
Previous Message Tom Lane 2007-08-07 01:23:18 Re: BUG #3504: Some listening sessions never return from writing, problems ensue