Why adding BEFORE TRIGGER affect client CPU?

Поиск
Список
Период
Сортировка
От George Woodring
Тема Why adding BEFORE TRIGGER affect client CPU?
Дата
Msg-id CACi+J=TxCX-upWaK4dDHm86bWM=cJ=kc0ax3O8CQrvprAghD7w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Why adding BEFORE TRIGGER affect client CPU?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
We are running 9.6.8-10 on our five postgres clusters.
We have ~25 database per cluster.
We have two servers that update a table in each database.

During the update process we were running a pgpsql function that calculated the difference in the new value with the previous.  This function would do a SELECT to get the previous value from the table and do the calculation before the UPDATE.  We also have an AFTER TRIGGER to save the row into a logging table.

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.

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.

Anyone know of a reason why this change would affect the client?  I would think that this would only affect the server side.  I could not see any messages printed out anywhere in logs showing any type of error.

Thanks,
George Woodring
iGLASS Networks
www.iglass.net

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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Refining query statement [DONE]
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Why adding BEFORE TRIGGER affect client CPU?