Re: prefix btree implementation

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: prefix btree implementation
Date: 2005-10-06 19:05:46
Message-ID: 1128625546.3738.44.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2005-10-06 at 09:38 -0400, Tom Lane wrote:
> Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> > It might be worth teaching the optimiser that if it has an index on an
> > immutable function that if we have WHERE x = k and a functional index on
> > f(x) then we can access the functional index with
> > f(x) = f(k), as long as we also reapply the original WHERE clause.
>
> As I just pointed out to Gaetano, this is utterly wrong. We can't
> assume that much about the behavior of equality.

For any function, yes, because you can always construct a function that
violates that. But it seems straightforward to introduce another
declarative form for which it is true, similar to the way that IMMUTABLE
allows us to make other assumptions at parse time. That's only worth it
if you believe that many useful functions follow that rule; I would say
that they do.

Best Regards, Simon Riggs

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-10-06 19:54:11 Re: comments on prepared transactions ...
Previous Message Luke Lonergan 2005-10-06 17:28:38 Re: [PERFORM] A Better External Sort?