Re: Slow planning time for custom function

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Slow planning time for custom function
Дата
Msg-id 20180324013552.lqrhlmywx42tg4oc@alap3.anarazel.de
обсуждение исходный текст
Ответ на Slow planning time for custom function  (bk@e8s.de)
Ответы Re: Slow planning time for custom function  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-performance
Hi,

On 2018-03-23 21:28:22 +0100, bk@e8s.de wrote:
> I have a table api.issues that has a text column "body" with long texts (1000+ chars). I also wrote a custom function
"normalizeBody"with plv8 that is a simple Text -> Text conversion. Now I created an index applying the function to the
bodycolumn, so I can quickly run
 
> 
> SELECT * FROM api.issues WHERE normalizeBody(body) = normalizeBody($1)
> 
> The issue is, that the planning time is very slow (1.8 seconds). When I replace "normalizeBody" with "md5", however,
Iget a planning time of 0.5ms.
 

How long does planning take if you repeat this? I wonder if a good chunk
of those 1.8s is initial loading of plv8.

Greetings,

Andres Freund


В списке pgsql-performance по дате отправления:

Предыдущее
От: Peter
Дата:
Сообщение: functions: VOLATILE performs better than STABLE
Следующее
От: David Rowley
Дата:
Сообщение: Re: Slow planning time for custom function