Re: different execution time for the same query (and same DB status)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Michel SALAIS <msalais(at)msym(dot)fr>, "'Francesco De Angelis'" <franc(dot)tozzus(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: different execution time for the same query (and same DB status)
Date: 2021-03-07 16:37:22
Message-ID: 1623345.1615135042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Julien Rouhaud <rjuju123(at)gmail(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurenz Albe 2021-03-08 09:17:59 Re: Slow query performance inside a transaction on a clean database
Previous Message Julien Rouhaud 2021-03-07 15:08:18 Re: different execution time for the same query (and same DB status)