Re: indexes on functions and create or replace function

From: "Matthew Dennis" <mdennis(at)merfer(dot)net>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: Christophe <xof(at)thebuild(dot)com>, "PGSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: indexes on functions and create or replace function
Date: 2008-08-29 02:37:29
Message-ID: e94d85500808281937m4f42cd6fh862b239bb1d7ac64@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 28, 2008 at 8:51 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com>wrote:

> There's no way at all in the general case (a function name could be
> passed as a parameter, for example). I think Matthew is suggesting to
> track dependencies at run time, but that seems a recipe for burnt
> fingers and an overall performance loss, for what seems a dubious gain.

I wouldn't think that it would be that much of a performance loss (except
for DDL type things where you were setting up the dependency in the first
place) though you would certainly know better than me. In any case, I know
it would be a lot of work and I wasn't suggesting doing it all at once, but
rather as a rule of thumb going forward - a continuous improvement to be
made as other work is done. If people in a better position than I to gage
this really think performance would suffer a great deal or that it's not
doable (or shouldn't be done), I respect that. It seems that we should at
least give warnings where we can though and probably doc it somewhere. "hey
user, you replaced a plpgsql function that was used in an index, your index
may now be invalid. Please see deatils at xyz".

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-08-29 02:41:20 Re: indexes on functions and create or replace function
Previous Message Christophe 2008-08-29 02:33:53 Re: indexes on functions and create or replace function