Thread: Is there any way to speed up PL/TCL functions?

Is there any way to speed up PL/TCL functions?

From
"Robert B. Easter"
Date:
I'm using some PL/TCL functions and triggers to do some special inserts.  When
I do an insert that uses these procedures, I get the "INSERT xxxxxx 1" response
back immediately, but then there is a pause before the next query is executed.
It appears as if the PL/TCL runs fast but after its finished it has to spend a
significant amount of time cleaning up before the next query can run.

Is this the way it is?  Any way to reduce this pause?

--
            - Robert

Re: Is there any way to speed up PL/TCL functions?

From
Tom Lane
Date:
"Robert B. Easter" <reaster@comptechnews.com> writes:
> I'm using some PL/TCL functions and triggers to do some special
> inserts.  When I do an insert that uses these procedures, I get the
> "INSERT xxxxxx 1" response back immediately, but then there is a pause
> before the next query is executed.  It appears as if the PL/TCL runs
> fast but after its finished it has to spend a significant amount of
> time cleaning up before the next query can run.

That doesn't make any sense as stated, but it might be that your
triggers are "deferred" (execute-at-commit).  I believe the INSERT
command response gets sent before transaction commit, so what's
probably really happening is just that your trigger is slow.

> Is this the way it is?  Any way to reduce this pause?

Hard to say without knowing what your trigger is doing.

            regards, tom lane