PostgreSQL 15: Discrepancies Between Manual and Scheduled Query Times
Explore the performance differences in PostgreSQL 15 between manual and scheduled queries.
In PostgreSQL 15, a nightly cleanup job ran in 30 milliseconds when executed manually, but took four seconds when scheduled. The same data and connection parameters were used. The discrepancy was traced to the query residing in a PL/pgSQL function, and adjustments to the plan cache mode resolved the issue, reducing execution time back to 30 milliseconds.
This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work