pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mischa <mischa.Sandberg@telus.net>
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 19:58:56 -0400
Message-ID: <23152.1112918336@sss.pgh.pa.us> (raw)
In-Reply-To: <1112909198.4255a58eae0d8@webmail.telus.net>
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>
	<16907.1112883624@sss.pgh.pa.us>
	<1112909198.4255a58eae0d8@webmail.telus.net>

Mischa <mischa.Sandberg@telus.net> writes:
> Quoting Tom Lane <tgl@sss.pgh.pa.us>:
>> 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 add
such.  The transitive-equality code pulls its weight because you so
often have situations like

	create view v as select a.x, ... from a join b on (a.x = b.y);

	select * from v where x = 42;

but I'm less able to think of common use-cases for transitive
inequality ...

			regards, tom lane



view thread (12+ messages)  latest in thread

Message-ID: <23152.1112918336@sss.pgh.pa.us>
Permalink:  ../23152.1112918336@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23152.1112918336@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, mischa.Sandberg@telus.net
  Subject: Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)
  In-Reply-To: <23152.1112918336@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