Re: huge disparities in =/IN/BETWEEN performance - Mailing list pgsql-sql

From Joe
Subject Re: huge disparities in =/IN/BETWEEN performance
Date
Msg-id 1170994335.697.55.camel@pampa
Whole thread Raw
In response to Re: huge disparities in =/IN/BETWEEN performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: huge disparities in =/IN/BETWEEN performance
List 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



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: huge disparities in =/IN/BETWEEN performance
Next
From: Tom Lane
Date:
Subject: Re: huge disparities in =/IN/BETWEEN performance