Re: [PERFORM] Incorrect estimates on correlated filters

2008-08-16 Thread Decibel!
On Aug 13, 2008, at 1:45 PM, Chris Kratz wrote: Yes, I know hints are frowned upon around here. Though, I'd love to have them or something equivalent on this particular query just so the customer can run their important reports. As it is, it's unrunnable. Actually, now that I think

Re: [PERFORM] Incorrect estimates on correlated filters

2008-08-14 Thread Gregory Stark
Craig Ringer [EMAIL PROTECTED] writes: It strikes me that there are really two types of query hint possible here. One tells the planner (eg) prefer a merge join here. The other gives the planner more information that it might not otherwise have to work with, so it can improve its decisions.

Re: [PERFORM] Incorrect estimates on correlated filters

2008-08-13 Thread Decibel!
On Aug 12, 2008, at 4:59 PM, Chris Kratz wrote: Ran into a re-occuring performance problem with some report queries again today. In a nutshell, we have filters on either multiple joined tables, or multiple columns on a single table that are highly correlated. So, the estimates come out

Re: [PERFORM] Incorrect estimates on correlated filters

2008-08-13 Thread Chris Kratz
On Wed, Aug 13, 2008 at 10:59 AM, Decibel! [EMAIL PROTECTED] wrote: On Aug 12, 2008, at 4:59 PM, Chris Kratz wrote: Ran into a re-occuring performance problem with some report queries again today. In a nutshell, we have filters on either multiple joined tables, or multiple columns on a

Re: [PERFORM] Incorrect estimates on correlated filters

2008-08-13 Thread Alvaro Herrera
Chris Kratz wrote: Unfortunately, if I don't think the sorting idea would help in the one case I'm looking at which involves filters on two tables that are joined together. The filters happen to be correlated such that about 95% of the rows from each filtered table are actually returned

Re: [PERFORM] Incorrect estimates on correlated filters

2008-08-13 Thread Craig Ringer
Decibel! wrote: Well... you could try and convince certain members of the community that we actually do need some kind of a query hint mechanism... ;) It strikes me that there are really two types of query hint possible here. One tells the planner (eg) prefer a merge join here. The other

[PERFORM] Incorrect estimates on correlated filters

2008-08-12 Thread Chris Kratz
Hello All, Ran into a re-occuring performance problem with some report queries again today. In a nutshell, we have filters on either multiple joined tables, or multiple columns on a single table that are highly correlated. So, the estimates come out grossly incorrect (the planner has no way to