[PERFORM] tuning a function to insert/retrieve values from a reference table

2007-07-10 Thread Marc Mamin
Hello, I have a simple table id/value, and a function that returns the id of a given value, inserting the later if not yet present. The probability that a value already exist within the reference table is very high. Different db users may have their own reference table with different content,

Re: [PERFORM] tuning a function to insert/retrieve values from a reference table

2007-07-10 Thread Tom Lane
Marc Mamin [EMAIL PROTECTED] writes: Can I optimize this function with: a) remove the EXCEPTION clause (Is there an underlying lock that prevent concurrent inserts ?) No. b) declare the function being IMMUTABLE ? Certainly not --- it's got side-effects. regards,