"Gurjeet Singh" <singh.gurjeet@xxxxxxxxx> writes: > Shouldn't PG make all efforts to not execute something when the result is > already known? Not if said effort would cost more than is saved, which would be by far the most likely result if we tried to cache all function results. regards, tom lane