Re: Including Snapshot Info with Indexes

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
Cc: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Including Snapshot Info with Indexes
Date: 2007-10-09 08:33:48
Message-ID: 1191918828.16320.33.camel@PCD12478
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

[snip]
> In the case of User-Defined functions, the user should be defining it
> as Deterministic.

The user CAN already define his functions as
"Deterministic=IMMUTABLE"... the problem is that many of us will define
functions as immutable, when in fact they are not. And do that by
mistake... and there's nothing postgres can do about that.

> Can we frame a set of guidelines, or may be some test procedure, which
> can declare a certain function as deterministic?

You mean postgres should check your function if it is really immutable ?
I can't imagine any way to do it correctly in reasonable time :-)
Imagine a function of 10 parameters which returns the sum of the
parameters all the time except for parameters all 1 it will randomly
return a value _once in a thousand executions_... please find a generic
algorithm which spots this function as not immutable in reasonable
execution time ;-)
So this example is a bit extreme, but don't underestimate the user ;-)

> I am just saying from the top of my mind. Even otherwise, if we can
> even restrict this indexing to only Built-in deterministic functions.,
> don't you think it would help the cause of a majority? I have just
> made the proposal to create the index with snapshot a optional one.

Restrictions like this are always confusing for the end user (i.e. why
can I use built-ins here and not my own ?). I leave to the actual coders
to say anything about code maintenance concerns...

Cheers,
Csaba.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Trevor Talbot 2007-10-09 08:44:44 Re: Timezone database changes
Previous Message Magnus Hagander 2007-10-09 08:31:29 Re: Latest ecpg patch broke MSVC build

Browse pgsql-patches by date

  From Date Subject
Next Message Sergey V. Karpov 2007-10-09 10:02:03 Re: Preliminary patch for tsearch example dictionaries/parsers in contrib
Previous Message Gregory Stark 2007-10-09 08:15:06 Re: Including Snapshot Info with Indexes