Re: indexes on functions and create or replace function

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Matthew Dennis <mdennis(at)merfer(dot)net>
Cc: PGSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: indexes on functions and create or replace function
Date: 2008-09-01 13:35:50
Message-ID: 48BBEFB6.5050200@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Dennis wrote:
> Given table T(c1 int) and function F(arg int) create an index on T using
> F(c1). It appears that if you execute "create or replace function F"
> and provide a different implementation that the index still contains the
> results from the original implementation, thus if you execute something
> like "select * from T where F(c1)" after replacing the function that it
> now misses rows that should be returned. In other words, the index
> isn't aware the function is now returning different values. That's not
> the correct/expected behavior is it? I would have expected that
> replacing the function would have caused any indexes that depend on that
> function to be reindexed/recreated with the new function implementation.

I have added a Todo item about this. But as you see, the problem is
quite large and involved.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2008-09-01 13:42:29 Re: SQL optimization - WHERE SomeField STARTING WITH ...
Previous Message Aaron Burnett 2008-09-01 12:44:41 Re: Assistance with SQL