Re: [PERFORM] Adding an additional join causes very different/slow query plan

2013-12-17 Thread Stephen Frost
* Joe Van Dyk (j...@tanga.com) wrote: > On Mon, Dec 16, 2013 at 4:14 PM, Tom Lane wrote: > > Yup, that's what I was just about to suggest. You might want to use > > 10 or 12 in case some of your queries are a bit more complex than > > this one --- but don't go overboard, or you may find yourself

Re: [PERFORM] Adding an additional join causes very different/slow query plan

2013-12-16 Thread Joe Van Dyk
On Mon, Dec 16, 2013 at 4:14 PM, Tom Lane wrote: > Joe Van Dyk writes: > > Hm, setting set join_collapse_limit = 9 seemed to fix the problem. Is > that > > my best/only option? > > Yup, that's what I was just about to suggest. You might want to use > 10 or 12 in case some of your queries are a

Re: [PERFORM] Adding an additional join causes very different/slow query plan

2013-12-16 Thread Tom Lane
Joe Van Dyk writes: > Hm, setting set join_collapse_limit = 9 seemed to fix the problem. Is that > my best/only option? Yup, that's what I was just about to suggest. You might want to use 10 or 12 in case some of your queries are a bit more complex than this one --- but don't go overboard, or yo

Re: [PERFORM] Adding an additional join causes very different/slow query plan

2013-12-16 Thread Joe Van Dyk
Hm, setting set join_collapse_limit = 9 seemed to fix the problem. Is that my best/only option? On Mon, Dec 16, 2013 at 1:52 PM, Joe Van Dyk wrote: > The actual query selects columns from each of those tables. > > If I remove the join on order_shipping_addresses, it's very fast. > Likewise, if