pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Arjen van der Meijden <acmmailing@vulcanus.its.tudelft.nl>
Cc: pgsql-hackers@postgreSQL.org
Cc: pgsql-performance@postgreSQL.org
Subject: Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)
Date: Thu, 07 Apr 2005 10:20:24 -0400
Message-ID: <16907.1112883624@sss.pgh.pa.us> (raw)
In-Reply-To: <20050407143120.GA29575@wolff.to>
References: <425413D3.5030304@vulcanus.its.tudelft.nl>
	<28552.1112809334@sss.pgh.pa.us>
	<425423A9.9000504@vulcanus.its.tudelft.nl>
	<5999.1112820690@sss.pgh.pa.us>
	<6326.1112825377@sss.pgh.pa.us>
	<20050407143120.GA29575@wolff.to>

Bruno Wolff III <bruno@wolff.to> writes:
>   Tom Lane <tgl@sss.pgh.pa.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



view thread (12+ messages)  latest in thread

Message-ID: <16907.1112883624@sss.pgh.pa.us>
Permalink:  ../16907.1112883624@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16907.1112883624@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruno@wolff.to, acmmailing@vulcanus.its.tudelft.nl, pgsql-hackers@postgreSQL.org
  Subject: Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)
  In-Reply-To: <16907.1112883624@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox