Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wCMat-001uFd-2o for pgsql-admin@arkaria.postgresql.org; Mon, 13 Apr 2026 19:05:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCMas-008TMb-0K for pgsql-admin@arkaria.postgresql.org; Mon, 13 Apr 2026 19:05:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wCMar-008TMT-26 for pgsql-admin@lists.postgresql.org; Mon, 13 Apr 2026 19:05:10 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCMaq-00000000tKX-2ARs for pgsql-admin@lists.postgresql.org; Mon, 13 Apr 2026 19:05:10 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-41708f6c3feso2739565fac.3 for ; Mon, 13 Apr 2026 12:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776107106; cv=none; d=google.com; s=arc-20240605; b=KkdOYnLR4HBG22cmOlRMgj7jc+Py7t1I2GHa0bcFc12snm4xV1aA+7YK3nvit0QU/j eOrhdGifnjM1C3vp0iMFhg7dOCdqsW+Hohi7VcfVcA5k/XEgDI7K8ELTJ/1zDldEX5zs XljPwoxMqCdjbid4FACWntLT+e/gTSrFqiz+htikEISwV9QsY+DvzwChERz2v+LHlSDJ ARE2PMSp3+fxAMClIglI+O1hgAsAiVc/y1m1Ec5aqA7/zqmnvRzZibzdYxnl2IGMuftu 6bFvzngvkDp9TysLps+/GrC8BLPiPvtdy+pyLYWBDzWueAhy4WTKVJLMBhnKy64jmDWp MV7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=B8Lf+XR12P6HPlgAzvG9hvLGpPErZjETIV3pVxZFy0w=; fh=IzlzZpoyZVc7UJw7B9df1bpTGQLO8ndF6nhOl2wAqrA=; b=Zp0c4QLg3a2SyqWGvBGs3e9l1SwLy+HyTCvHp9FhsFjTvBhXpzSBfZqy2PdiR3Yg+X mnioh+C6mWvXsbizlfRIeK830Kb8FSN3E3x8syHlQb4O107qN0dxjd79gRjJFRgfb047 1tXP54wZtyC7TEh0Sh8V1L2Il+yh0GArMjBno/lPB/MT5i/sFbWesjr2mxRDnvz9TJfs 8btWR/4wWd/odXLx/bVG6gPe27pxqN+EZ8M1yvf3ZoBIueU/WWGsJpxTkUa8VszeHraB eBSegMSkf+StL9EmG3ow94VDRmJPqwT5aPiwFGL5J2FXhcyYn7YJxjTVZJ5qMp3AFPzl Xd2g==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776107106; x=1776711906; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B8Lf+XR12P6HPlgAzvG9hvLGpPErZjETIV3pVxZFy0w=; b=QEyBSxNu4rLMalXfPCYTYAOU9inyIIOLLMfJZpNoju0h8PuaXkwK1jadLncmgPVi1Q fJC6dPSouyvvghlSy/xBnSmrYw89tzvzObIIkXUzZj98Ghdkw1LL9S1AOXan9fs0FW0X preGSB3ejBxaGkYNluViVcU5Q97G28vmYw4r46GrOzHFp6QT4reOEDExbVgcTNoMhb5Z H8hvAQqozn2aGt1XIsoppMWjurd5Vfo/BMw4S8x1YVdOKsmUUkwixme3k+ku4Kuhpn4f soSikN2VbFoI0viE0POLiki1Lq1TSiEeD1zHSgpcld8rcdu16SypqrVLHz3AqS4+RkQ8 GJyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776107106; x=1776711906; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=B8Lf+XR12P6HPlgAzvG9hvLGpPErZjETIV3pVxZFy0w=; b=dG8wVll+VZADfpdgP4PmiHvpCIIwLbrL0faguBLAbRc9a+V7oGVFupSYmxVPMIFAfT qq8RxBzNY33sXGd4JqAM1Veeq8sg11XYVetDu7EPaJCrafi0cfhiD2O0gKvPyNCU9tfq 6v8lZl7J/MkItIcPE6Gj/v/MuGE7/ocA+lTvZ/Zz9S75qu9nPIdVIcJw/rIuIpw81KQ+ aRRZUzvZtIKJ206bsYMwokfuJ8t4zQb8GUnDpCsGobmnq1s1VhvxGW9xC7OZkaYzB6KY C933BWy+JyHF5WRV3qySqRKWhdLPiIfdpGrWYGzadRn1MainscLyu1YH5ZJJnbN7wDy1 RjGg== X-Forwarded-Encrypted: i=1; AFNElJ91hVmLfG2OkeaTWA+cmcXKYw9a5WUZrCWkk/LKvnGRBSeJmx9wPrmyHnvnpUD+Uc3eRIvYpLw16q740w==@lists.postgresql.org X-Gm-Message-State: AOJu0Yz3EGsXwilbcUQKXBr8Hx5PFawmN4A8X78CUrxTb1kV09mF0CBm Yrnb8LbkqYCSBvQksd+BSt+cXM5geEhhjcs+Pe2YMhxeIO/+9ukibfPYZTSus6ITv6EFlxMhGck SnJj9lZO/wAYDC/PXO+ouF9CfZcBa8nw= X-Gm-Gg: AeBDieuF6xLRzK5Xi7cJB2ltYDo/MZrn7KfOGc3rbIIXImOdhIti5tlZ9Asao8kswjT HfinFTMs6PhhYgU17EPnHCYV1Gk0IjzSLJDNdbKY7U2rFBp3svRtskQqo4069OfOZcyhWGt2TMG 3Ciw/zosnGwIxfCR03s00qPxKTaw1MxxPcEDN82d3jkMIQbneixsOf+Zsj5+/M+X84NWYNmQIZV v6caovXFmJ1xhIgPNFUkXpquRIHvOHkhedP8NXL3BVATIZEaSG4PBFGkSzy+Iwuf+RkDs10hEls pJPViaIJ X-Received: by 2002:a05:6870:16e2:b0:41b:f608:177f with SMTP id 586e51a60fabf-423e0ed6960mr7653065fac.17.1776107106192; Mon, 13 Apr 2026 12:05:06 -0700 (PDT) MIME-Version: 1.0 References: <2fd0442020d5b23609873f999b7d374875875689.camel@cybertec.at> In-Reply-To: From: Ron Johnson Date: Mon, 13 Apr 2026 15:04:54 -0400 X-Gm-Features: AQROBzDVdcIt3O6uBaldlBZVqHoXlCPtpCx-xKVMEvGSVxrVhXSzVsdLpRb5-fc Message-ID: Subject: Re: Slowness To: Raj Cc: Laurenz Albe , Pgsql-admin Content-Type: multipart/alternative; boundary="00000000000025d1e4064f5c296a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000025d1e4064f5c296a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'd: 1. enable log_min_duration_statement, 2. capture pg_stat_user_indexes, 3. tune autovacuum vacuum and analyze threshold values (the defaults are in my experience way too high), 4. query pg_stat_user_tables joined to pg_class to see which tables need more manual vacuuming and/or analyzing, and 5. check effective_cache_size, shared_buffers, work_mem and maintenance_work_mem to see if they're set to Best Practice values. On Mon, Apr 13, 2026 at 1:44=E2=80=AFPM Raj w= rote: > Ok great. If I start with normal health check top, free -h, patronictl > list, and all status of components such as etcd, haproxy etcd pgnouncer , > then stat user tables, pgstatactivity, pgstatstatements and error log. > Apart from this, what dba should do? > > On Mon, 13 Apr 2026, 22:45 Laurenz Albe, wrote= : > >> On Mon, 2026-04-13 at 22:05 +0530, Raj wrote: >> > On Mon, 13 Apr 2026, 18:32 Laurenz Albe, >> wrote: >> > > On Mon, 2026-04-13 at 18:25 +0530, Raj wrote: >> > > > When customer says they are facing slowness, what all wee need to >> check in >> > > > postgres db with 3 node patroni set up (sync between 1 and 2) - >> async with dr. >> > > > >> > > > We recently migrated from oracle to postgres..vacuum analyze is >> done. >> > > > >> > > > How to check this during the time slowness faced and also after >> couple of hrs of issue window. >> > > > >> > > > Should we start with pgstatstatements and logs or how is it. >> Help.me hight level what all I need to check >> > > >> > > You have to figure out *what exactly* is slow. The customer has to >> tell you which >> > > statements are slow. The parameter "log_min_duratoin_statement" migh= t >> help. >> > > >> > > Then you have to tune those statements. >> > >> > How long min duration statement is decided. Is it dba who decide how >> much needs to be set? >> >> Sorry, I made a typo. It is a database parameter and called >> "log_min_duration_statement". >> >> Your questions seem to indicate that you have almost no knowledge about >> PostgreSQL. >> Without database knowledge, it is impossible to find slow statements, le= t >> alone tune >> them. Perhaps you should spend some time with the PostgreSQL >> documentation or hire >> a consultant. >> >> Yours, >> Laurenz Albe >> > --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --00000000000025d1e4064f5c296a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'd:
1. enable = log_min_duration_statement,=C2=A0
2. capture=C2=A0pg_= stat_user_indexes,=C2=A0
3. tune autovacuum vacuum and analyze th= reshold values (the defaults=C2=A0are in my experience way too high),=C2=A0=
4. query=C2=A0pg_stat_user_tables joined to pg_class to see whic= h tables need more manual vacuuming and/or analyzing, and
5. chec= k effective_cache_size, shared_buffers, work_mem and maintenance_work_mem t= o see if they're set to Best Practice values.

On M= on, Apr 13, 2026 at 1:44=E2=80=AFPM Raj <rajeshkumar.dba09@gmail.com> wrote:
Ok great.= If I start with normal health check top, free -h, patronictl list, and all= status of components such as etcd, haproxy etcd pgnouncer , then stat user= tables, pgstatactivity, pgstatstatements and error log. Apart from this, w= hat dba should do?

On Mon, 13 Apr 2026, 22:45 Laurenz Albe, <laurenz.albe@cybertec.at> wrote:
On = Mon, 2026-04-13 at 22:05 +0530, Raj wrote:
> On Mon, 13 Apr 2026, 18:32 Laurenz Albe, <
laurenz.albe@cybert= ec.at> wrote:
> > On Mon, 2026-04-13 at 18:25 +0530, Raj wrote:
> > > When customer says they are facing slowness, what all wee ne= ed to check in
> > > postgres db with 3 node patroni set up (sync between 1 and 2= ) - async with dr.
> > >
> > > We recently migrated from oracle to postgres..vacuum analyze= is done.
> > >
> > > How to check this during the time slowness faced and also af= ter couple of hrs of issue window.
> > >
> > > Should we start with pgstatstatements and logs or how is it.= Help.me hight level what all I need to check
> >
> > You have to figure out *what exactly* is slow.=C2=A0 The customer= has to tell you which
> > statements are slow. The parameter "log_min_duratoin_stateme= nt" might help.
> >
> > Then you have to tune those statements.
>
> How long min duration statement is decided. Is it dba who decide how m= uch needs to be set?

Sorry, I made a typo.=C2=A0 It is a database parameter and called "log= _min_duration_statement".

Your questions seem to indicate that you have almost no knowledge about Pos= tgreSQL.
Without database knowledge, it is impossible to find slow statements, let a= lone tune
them.=C2=A0 Perhaps you should spend some time with the PostgreSQL document= ation or hire
a consultant.

Yours,
Laurenz Albe


--
Death to <Redacted>, and butter sauce.Don't boil me, I'm still alive.
<Redacted> lobs= ter!
--00000000000025d1e4064f5c296a--