pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mladen Gogala <gogala.mladen@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Postgresql 14 performance
Date: Sun, 21 Aug 2022 14:27:50 -0400
Message-ID: <62c9a8d8-8c0f-3c11-5cca-e05e126c25d8@gmail.com> (raw)
In-Reply-To: <CAC0w7LL+uFgPvctiHMxrVZV-DnNVg2K_wFaeZwM96XQFkjk1uA@mail.gmail.com>
References: <CAC0w7LL+uFgPvctiHMxrVZV-DnNVg2K_wFaeZwM96XQFkjk1uA@mail.gmail.com>

On 8/21/22 12:05, Kenny Bachman wrote:
> Hi Team,
>
> Have a lovely Sunday.
> I have a problem with PostgreSQL performance. I am using PostgreSQL 
> 14.5 on Linux physical server. My query was taking 1 or 2 seconds 
> yesterday, but today it is taking 5-6 seconds. Also, nothing has 
> changed in the database. Also, when I run the query for the second 
> time, the query runs for the same time, so I expect it to be more 
> performant the second time because of the cache.
> (the database cache hit ratio is 97,8)
>
> Lastly, some other queries take milliseconds normally, but sometimes 
> they take minutes. I didn't understand why this is happening. (There 
> is no lock, no table bloating and up to date analyze)
>
>
> I am adding the explain analyze output as an attachment.

Hi Kenny,

The query is small but the plan is huge and likely to use a lot of 
memory. What is with the rest of the system? Any paging? There are lots 
of steps that are never executed in the plan. The plan looks great, 
mostly unique index equality scans. Did you check pg_stat_activity for 
wait_event_type and wait_event? What is your SQL waiting for?

Regards

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

view thread (20+ messages)  latest in thread

Message-ID: <62c9a8d8-8c0f-3c11-5cca-e05e126c25d8@gmail.com>
Permalink:  ../62c9a8d8-8c0f-3c11-5cca-e05e126c25d8@gmail.com/
Also on:    postgresql.org/message-id/62c9a8d8-8c0f-3c11-5cca-e05e126c25d8@gmail.com

 · 

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-admin@postgresql.org
  Cc: gogala.mladen@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Postgresql 14 performance
  In-Reply-To: <62c9a8d8-8c0f-3c11-5cca-e05e126c25d8@gmail.com>

* 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