I'm running a scheduled job using pgAgent on PostgresSQL 9.5. The duration of this job seems to grow over subsequent runs, and this slow down doesn't appear to be a direct relationship to the amount of data processed each time.
The job itself is a function, which opens a cursor and records results in another table. The function always processes one hour of data, but that hour may contain more or less records depending on the time of day.
My question is, is there any resource management I need to do when creating a pgAgent job? In other words, does anything persist between runs that should be cleaned up by the developer or is each instance of the job completely sandboxed?
Asked by Matt
(121 rep)
Sep 14, 2016, 04:59 AM