Saturday, August 30, 2008

Re: [GENERAL] indexes on functions and create or replace function

On Thu, Aug 28, 2008 at 7:45 PM, Matthew Dennis <mdennis@merfer.net> wrote:
Another question though.  Since I could potentially start transaction, drop indexes/checks, replace function, create indexes/checks, commit tranasaction could I deal with the case of the constant folding into the cached plan by flushing the entire cache in the same transaction?  Is cache flushing transactional?  The cases I have for this are infrequent in time and the overhead of reindexing things, rechecking checks/unique indexes already dwarf the performance lost to flushing the cache.

On a related note, if I had a maintenence window where I can shutdown all DB access, make the referenced changes to the functions/indexes/caches/checks and restart PG - in your opinion, are there other likely problems to changing an immutable function under those circumstances, or should that be pretty safe?  In other words, I have a function that has indexes on it that does the wrong thing - what do I do to replace it?


In the thread below, we kind of got side tracked on some other stuff and I never got an answer to the questions above.  Does anyone have any insight/suggestions about the best way to replace a function that is used by an index?

http://groups.google.com/group/pgsql.general/browse_thread/thread/92289ef0c2f5a109/8f96fb24bdd668e8

No comments: