Re: Why adding BEFORE TRIGGER affect client CPU? - Mailing list pgsql-general

From Tom Lane
Subject Re: Why adding BEFORE TRIGGER affect client CPU?
Date
Msg-id 1130.1547838060@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why adding BEFORE TRIGGER affect client CPU?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Why adding BEFORE TRIGGER affect client CPU?
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 1/18/19 10:23 AM, George Woodring wrote:
>> We recently changed the process to do a BEFORE TRIGGER to do the 
>> calculation between OLD and NEW instead of the separate function with 
>> the SELECT.

> So what was the exact change?

>> After doing this, CPU on our two client servers went crazy.  CPU on the 
>> database servers look unchanged.  Rolling back this change fixed our 
>> client CPU issue.

> What is the client server and what is it doing?

Indeed.  There's no direct way that messing with a trigger would have
caused extra CPU on the client side.  I speculate that the trigger
caused the data to look different in a way that your client app wasn't
expecting, causing it to do something funny --- maybe loop trying to
find a matching record, or something like that.  Or maybe removing the
step that did the calculation client-side had side effects you weren't
expecting --- what uses that value client-side, exactly?

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Why adding BEFORE TRIGGER affect client CPU?
Next
From: "Peter J. Holzer"
Date:
Subject: Re: Oracke BLOB to Postgres BYTEA using ora2pg