Re: Slow C Function - Mailing list pgsql-performance

From Tom Lane
Subject Re: Slow C Function
Date
Msg-id 25876.1147233129@sss.pgh.pa.us
Whole thread Raw
In response to Slow C Function  ("Adam Palmblad" <adam@terapeak.com>)
List pgsql-performance
"Adam Palmblad" <adam@terapeak.com> writes:
> We've got a C function that we use here and we find that for every
> connection, the first run of the function is much slower than any
> subsequent runs. ( 50ms compared to 8ms)

Perhaps that represents the time needed to load the dynamic library
into the backend?  If so, the "preload_libraries" parameter might
help you fix it.  Or consider pooling connections.  Or build a custom
executable with the function linked in permanently.

            regards, tom lane

pgsql-performance by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: PostgreSQL VACCUM killing CPU
Next
From: Scott Lamb
Date:
Subject: Re: [GENERAL] Arguments Pro/Contra Software Raid