Re: Slow planning time for custom function

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: bk(at)e8s(dot)de, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Slow planning time for custom function
Date: 2018-03-24 01:52:29
Message-ID: CAKJS1f9-YDDyCkO3VhfNoNbi9DatkL+p0BfJFyi-6H_DBr1Y6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 24 March 2018 at 14:35, Andres Freund <andres(at)anarazel(dot)de> wrote:
> How long does planning take if you repeat this? I wonder if a good chunk
> of those 1.8s is initial loading of plv8.

Maybe, but it also could be the execution of the function, after all,
the planner does invoke immutable functions:

# explain verbose select lower('TEST');
QUERY PLAN
-------------------------------------------
Result (cost=0.00..0.01 rows=1 width=32)
Output: 'test'::text
(2 rows)

Would be interesting to see what changes without the IMMUTABLE flag.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurenz Albe 2018-03-25 05:00:43 Re: functions: VOLATILE performs better than STABLE
Previous Message Andres Freund 2018-03-24 01:35:52 Re: Slow planning time for custom function