Re: stable and immutable functions in GROUP BY clauses.

From: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: stable and immutable functions in GROUP BY clauses.
Date: 2013-09-16 19:22:39
Message-ID: B6F6FD62F2624C4C9916AC0175D56D880CE1B381@jenmbs01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


>
> Hello,
>
> Stable and immutable functions do not improve performance when used within the GROUP BY clause.
> Here, the function will be called for each row.
>
> To avoid it, I can replace the funtion by its arguments within GROUP BY.

Shame on me !
This is of course bullsh... It has nothing to do with immutability and can only applies to few cases

e.g: it's fine for select x+1 ... group by x,
but not for select x^2 ... group by x

Marc Mamin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2013-09-16 23:40:28 Re: function execute on v.9.2 slow down
Previous Message Niels Kristian Schjødt 2013-09-16 15:53:27 How to optimization database for heavy I/O from updates (software and hardware)