Re: Partial Indices vs. mixing columns and functions - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Partial Indices vs. mixing columns and functions
Date
Msg-id 20010717130851.B26211@svana.org
Whole thread Raw
In response to Re: Partial Indices vs. mixing columns and functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Partial Indices vs. mixing columns and functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, Jul 16, 2001 at 09:45:32PM -0400, Tom Lane wrote:
> (But what the planner can recognize as matching a query's
> WHERE clause is currently much more restricted, just ANDs
> and ORs of simple VAR OP CONST clauses.  This could be
> improved in the future.)

I've been think about adding IS (NOT) NULL type clauses and it doesn't look
too hard but I wonder if my logic is right.

> > Both the functions used in functional indexes and the
> > predicates used in partial indexes must be deterministic.
> > Are users responsible for it ?
>
> Yes.  I don't see how the system could enforce that, without
> prohibiting lots of useful cases.
>

Well, isn't there an attribute on a function that indicates whether the same
input gives the same output (cachable?).  I think that's all that would be
required and not restrict any useful cases.

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.

pgsql-general by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: Partial Indices vs. mixing columns and functions
Next
From: Janning Vygen
Date:
Subject: Application Design and PostgreSQL