Re: [PERFORM] Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)

2005-04-10 Thread a3a18850
Quoting Tom Lane [EMAIL PROTECTED]: Mischa [EMAIL PROTECTED] writes: Quoting Tom Lane [EMAIL PROTECTED]: WHERE a.x b.y AND a.x 42 Out of curiosity, will the planner induce b.y 42 out of this? No. There's some smarts about transitive equality, but none about transitive

Re: [PERFORM] Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)

2005-04-07 Thread Bruno Wolff III
On Wed, Apr 06, 2005 at 18:09:37 -0400, Tom Lane [EMAIL PROTECTED] wrote: Can anyone suggest a more general rule? Do we need for example to consider whether the relation membership is the same in two clauses that might be opposite sides of a range restriction? It seems like a.x

Re: [PERFORM] Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)

2005-04-07 Thread Tom Lane
Bruno Wolff III [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] wrote: Can anyone suggest a more general rule? I think it makes sense to guess that a smaller fraction of the rows will be returned when a column value is bounded above and below than if it is only bounded on one side,

Re: [PERFORM] Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)

2005-04-07 Thread Mischa
Quoting Tom Lane [EMAIL PROTECTED]: Yeah, the whole thing is only a heuristic anyway. I've been coming around to the view that relation membership shouldn't matter, because of cases like WHERE a.x b.y AND a.x 42 which surely should be taken as a range constraint. Out of

Re: [PERFORM] Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)

2005-04-07 Thread Tom Lane
Mischa [EMAIL PROTECTED] writes: Quoting Tom Lane [EMAIL PROTECTED]: WHERE a.x b.y AND a.x 42 Out of curiosity, will the planner induce b.y 42 out of this? No. There's some smarts about transitive equality, but none about transitive inequalities. Offhand I'm not sure if it'd be useful to