[Fwd: Re: [PERFORM] Seq scan on zero-parameters function]

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: alvarezp(at)alvarezp(dot)ods(dot)org
Cc: Lista dyskusyjna pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: [Fwd: Re: [PERFORM] Seq scan on zero-parameters function]
Date: 2004-02-06 07:28:39
Message-ID: 40234227.7060209@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dnia 2004-02-06 08:19, Użytkownik Octavio Alvarez napisał:
> Hi!
>
> I'd like to know if this is expected behavior. These are two couples of
> queries. In each couple, the first one has a WHERE field = function()
> condition, just like the second one, but in the form WHERE field =
> (SELECT function()). In my opinion, both should have the same execution
> plan, as the function has no parameters and, therefore, is constant.
Nope.

What would you say about function without params returning timeofday()?
Is it constant?

If you are sure, that your function returns constant value - declare it
as IMMUTABLE. (look at CREATE FUNCTION documentation)

Regards,
Tomasz Myrta

Browse pgsql-sql by date

  From Date Subject
Next Message Octavio Alvarez 2004-02-06 08:43:12 Re: Seq scan on zero-parameters function
Previous Message Octavio Alvarez 2004-02-06 07:19:04 Seq scan on zero-parameters function