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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Arjen van der Meijden <acmmailing(at)vulcanus(dot)its(dot)tudelft(dot)nl>, pgsql-hackers(at)postgreSQL(dot)org, pgsql-performance(at)postgreSQL(dot)org
Subject: Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)
Date: 2005-04-07 14:20:24
Message-ID: 16907.1112883624@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Bruno Wolff III <bruno(at)wolff(dot)to> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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, even if the bounds aren't fixed. You can
> certainly be wrong.

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2005-04-07 14:31:20 Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)
Previous Message Tom Lane 2005-04-07 14:14:27 Re: 'now' runtime

Browse pgsql-performance by date

  From Date Subject
Next Message Bruno Wolff III 2005-04-07 14:31:20 Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)
Previous Message Keith Worthington 2005-04-07 14:17:22 4 way JOIN using aliases