Re: huge disparities in =/IN/BETWEEN performance

From: Joe <dev(at)freedomcircle(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, George Pavlov <gpavlov(at)mynewplace(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: huge disparities in =/IN/BETWEEN performance
Date: 2007-02-09 04:12:14
Message-ID: 1170994335.697.55.camel@pampa
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Tom,

On Thu, 2007-02-08 at 22:50 -0500, Tom Lane wrote:
> There's a datatype abstraction issue involved: what does it take to
> prove that "x >= 10 AND x <= 10" is equivalent to "x = 10"? This
> requires a nontrivial amount of knowledge about the operators involved.
> We could probably do it for operators appearing in a btree operator
> class, but as Alvaro says, it'd be cycles wasted for non-dumb queries.

Are you saying the planner is datatype-agnostic and can't tell that x
is, say, as in the example above, an INTEGER and therefore cannot
transform one expression into another? What about "x = 10 AND x < 5"?
Can't it reduce that to FALSE?

Joe

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2007-02-09 04:24:44 Re: huge disparities in =/IN/BETWEEN performance
Previous Message Tom Lane 2007-02-09 03:50:05 Re: huge disparities in =/IN/BETWEEN performance