Re: Slow planning time for custom function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 2018-03-23 21:28:22 +0100, bk@xxxxxx 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 body column, 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, I get 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




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux