Re: function(contants) evaluated for every row

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: function(contants) evaluated for every row
Date: 2010-11-24 19:52:22
Message-ID: 16830.1290628342@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Notice the to_date()'s were not converted to constants in EXPLAIN so
> they are evaluated for every row. to_date() is marked STABLE.

> Is this something we should improve?

No. This is per expectation. Only IMMUTABLE functions can be folded to
constants in advance of the query.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-11-24 19:57:53 Re: function(contants) evaluated for every row
Previous Message Bruce Momjian 2010-11-24 19:36:08 function(contants) evaluated for every row