Re: Please help! Query jumps from 1s -> 4m

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Jamie Thompson <jthompson(dot)neuk(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Please help! Query jumps from 1s -> 4m
Date: 2020-05-05 19:28:36
Message-ID: 20200505192836.GD28974@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, May 04, 2020 at 02:12:01PM -0500, Justin Pryzby wrote:
> On Mon, May 04, 2020 at 08:07:07PM +0100, Jamie Thompson wrote:
> > Additionally, the execution plans for the 10th + following queries look
> > fine, they have the same structure as if I run the query manually. It's not
> > that the query plan switches, it seems as though the same query plan is
> > just > 200X slower than usual.
>
> Are you able to reproduce the problem manually ?
>
> With/without PREPARE ?
> https://www.postgresql.org/docs/current/sql-prepare.html

Also, you should be able to check if that's the problem by doing either:
plan_cache_mode = force_generic_plan;
Or (I would think) DISCARD PLANS;

https://www.postgresql.org/docs/12/runtime-config-query.html

--
Justin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message James Thompson 2020-05-05 21:10:18 Re: Please help! Query jumps from 1s -> 4m
Previous Message Laurenz Albe 2020-05-05 08:25:57 Re: NUMA settings