UPDATE and INDEX on expensive function with (IsCachable)
UPDATE and INDEX on expensive function with (IsCachable)
От:
"Albert REINER" <areiner@tph.tuwien.ac.at>
Дата:
Suppose some _cachable_ function f is expensive, but its results are often needed. So, to speed up queries, we have an index on f(table.field). I wonder what happens when we update a tuple of that table: will f be re-computed if table.field is not changed? What if the update explicitly re-sets table.field to its old value? Thanks in advance, Albert.
Re: UPDATE and INDEX on expensive function with (IsCachable)
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Albert REINER" writes: > Suppose some _cachable_ function f is expensive, but its results are > often needed. So, to speed up queries, we have an index on > f(table.field). I wonder what happens when we update a tuple of that > table: will f be re-computed if table.field is not changed? Yes. regards, tom lane