pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Michel SALAIS <msalais@msym.fr>
Cc: 'Francesco De Angelis' <franc.tozzus@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: different execution time for the same query (and same DB status)
Date: Sun, 07 Mar 2021 11:37:22 -0500
Message-ID: <1623345.1615135042@sss.pgh.pa.us> (raw)
In-Reply-To: <20210307150818.hiqv26pmrovi3ced@nol>
References: <CAHWr2Cc0TAEQ-Af_x0zYPjZ5H5QerBU0d6cmzCTC6W5NLd2vew@mail.gmail.com>
	<CAHWr2CeC_Q+kOBY7O3HmX1qVRHch26yiDw6HeUZGGaBpANubVQ@mail.gmail.com>
	<00ce01d71361$4dd83750$e988a5f0$@msym.fr>
	<20210307150818.hiqv26pmrovi3ced@nol>

Julien Rouhaud <rjuju123@gmail.com> writes:
> +1, and more generally please follow
> https://wiki.postgresql.org/wiki/Slow_Query_Questions.

Yeah.  FWIW, the most likely explanation for the change in behavior is
that by the time of the second execution, auto-analyze has managed to
update the table's statistics, and that for some reason that's changing
the plan for the worse.  But then the next question is why and what
can be done about that.  See the wiki entry for info that would be
helpful in diagnosing this.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <1623345.1615135042@sss.pgh.pa.us>
Permalink:  ../1623345.1615135042@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1623345.1615135042@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rjuju123@gmail.com, msalais@msym.fr, franc.tozzus@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: different execution time for the same query (and same DB status)
  In-Reply-To: <1623345.1615135042@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox