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 1wBGh7-000tcq-3D for pgsql-admin@arkaria.postgresql.org; Fri, 10 Apr 2026 18:35:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBGh5-00E6Xr-1F for pgsql-admin@arkaria.postgresql.org; Fri, 10 Apr 2026 18:35:04 +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 1wBGh4-00E6Xi-2n for pgsql-admin@lists.postgresql.org; Fri, 10 Apr 2026 18:35:03 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBGh3-00000000Oqx-0Poa for pgsql-admin@lists.postgresql.org; Fri, 10 Apr 2026 18:35:03 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7d7e878a7a9so292872a34.0 for ; Fri, 10 Apr 2026 11:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775846099; cv=none; d=google.com; s=arc-20240605; b=ZzXfKe4EFHk4uXC/bjVxrVv0KmhvD01oM3YbtRBdUvybTBTzUTuk9NOfJXBaM2UYg6 PXo62Nb1r9nmXLZ0bExNtlBu0SVUx67pJnmUi084a7UHX3JRn/ivbQuG9hJkmfxc80Dc 3tY47mt/CeQgDeGz2R3lH6TiLZlqZS4f8RxfdQDFoeJ3MrpNDBoSfnpLNbTmwsXTfViF GnhCDQNFS97Kk37E0iyqlJPvcEEol9i0ScjNSngml3wAc2qGgvD7CBj7eqdvSy48cehb 1prmphIzXBg9jWJLIC11WfsA0bSYji6uMgStIV+GhRG71Lo9v2JAOeQHdPOZjQpRdHOg /S3A== 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=wivND73ypjQtYJ5pIJzDQK0T65ELISKDvpsVXLZHEXE=; fh=qp3koLE/B6oi4QJ1HOSoWqTX4M5IeWa/ngrMsCv1wmM=; b=ih7ia18zm6z7SJB7b5NPqMOnq6ihPFvXmeALHAKHgnFrVUVQFhVSu8DVJmSkHB7oaH uVLy0T2U8emzADXWf3hv+OG3Q34V2IXQnyjhXUloI9rxUM/sodnnyhJAKZOoli/w1uIS qHtZa58q+NK73m7eAGHXsqrBD9B6d5r0stWpmyG5Wlt6hi3zOy8zVHk6nVJWPcj/yvUH 0Bj6eFCw6AF6V9Lo8bwEqm47a1nLsYxu3KMNH8/mH7tfqMrI18mhZ+ApvLynR7sleoUB yc1ajIEY1ar16RtWUUqq+jM3LsO7rwLe7Yc/04TD1kYjnIxBHb3mxRH8oNYTuJt6XAxy HSug==; 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=foresightweb-net.20251104.gappssmtp.com; s=20251104; t=1775846099; x=1776450899; 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=wivND73ypjQtYJ5pIJzDQK0T65ELISKDvpsVXLZHEXE=; b=p4z+OkAwiuyNH3qsh1JXBWtnrDWKAFqt5MkuHWi+SyTdYAAaytxr+9e8NIQm3zZr7H COFIXIal+k/QOBK11r67+vNHLsPj05fcKjZkQSPN6MJD/s8RbQ34WsArj+p6XZklFD9z lkap83rdDp/cem+DyDqJmAQy1T1yguofripqdkTr81vm9V3bwmgHpxbNSDJj2WMwWDu1 ZXPh7CHQo24ax3OQmAgh8YQbcht6qEyrNfw8Seaqy6W5AySowcuAhzK3cnJUDzOclRHL fRatHCelDgIjlFDjfuUqic4U8WWUtXu5IcUDfcFJ+wl5o40kKvgvH6qRZkzECGRbHLWu 1FVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775846099; x=1776450899; 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=wivND73ypjQtYJ5pIJzDQK0T65ELISKDvpsVXLZHEXE=; b=tU7dD+/baM5BZy+pBAoC/2sibFdP/7xxLSat79dZE2OwNaaBD6rSnKafvWsagik4Zv F+23xs9NgFFsTXWU76RWnNPfEGwGsB+D9bkXioBa5jpidh9c6bV8kHEjiJCVPl5pHUeF +44Njtns9zBpi10S2+fZSfn/GcHGNrgsWs/3f1L40eBQ0O6nJ15mGyolOH1lyutLC7xn dP9vGLY7z2nNpFG85ckro3Vd04f3WVEzDPVD6jn1no4PnLjAg9jk0LpQw1dJSMAvFEw+ zcpO7/Zkh0HHnHjrZQzQD/ROm6lH4kN/BD6tpnGTBlfyjKoSBNpoKr675CKOrYNts3LB e+Aw== X-Gm-Message-State: AOJu0YzbyO5AUW6dFz0RDCj7VcsMShUeaqpsVASxQK2GAyb65iaijYI0 /oTfogf6aPnvSI4AWfJhilrP4HOAC1ZlhZex2xDQBiynl96E896BHGBLqvcBxK8wTsUzVVAMQA3 fqXtx16CfRtCjtCGa/qRe5eTxVHImFEvdSq3b/DUiP+i3N+x6usqiNSU= X-Gm-Gg: AeBDieu9DjqoOIbvcRvQXKesuKEvl3YK7lG/ppx/I/U5Y7yd2DkSHpBKQ8FXSlQk1Lu AgrIY7iLp+iVtXOp6GRe4sZztZz0yt7UMR84fhkQ5ARCuCIB/tKnSfT8+UgkoNE0CHIwhPeIs5K 26GprGXJAPO/JXxiVZfHa4+JTfm6zCqIeAgRxsO/wrTBSs6g0eR3ZVYtM8UZbrhrcxDMT46qMLf 8rrznHUxOaRIGXrIRZh6/yL3Kdu5jEe66s4IsLXW9DQgZJtu0I8cOTNhrXC7dbIyKnAYAA2eKzx Nfs20iX7irDkJgAAEskh/Tw6yhABIpJ337xrQdU0CnJELqvKCg+70K7RjizEckL/2PZ42kGlbx5 Oq4sH X-Received: by 2002:a05:6871:878a:b0:41c:20cd:c0a8 with SMTP id 586e51a60fabf-423e10a4c00mr1630905fac.3.1775846098991; Fri, 10 Apr 2026 11:34:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Keith Date: Fri, 10 Apr 2026 14:34:22 -0400 X-Gm-Features: AQROBzBc31SjbTuWBa4C2G4VMWYrxsUuhgb9kv3-sUD8RxdC24ieTVWAyYxiKg4 Message-ID: Subject: Re: Seeking Advice: PostgreSQL Performance Troubleshooting Without Third-Party Tools To: mahamood hussain Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="000000000000e82be2064f1f63f4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e82be2064f1f63f4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable For log analysis, pgbadger (https://pgbadger.darold.net/) is the best tool I've come across. Just be sure to adjust your log_line_prefix to include information such as client host/IP, role, database and error codes. Turn on other settings such as logging checkpointing, temp file generation and locking. The more you log, the more that pgbadger can help analyze. Just keep an eye on your log generation since you don't want that to in turn affect your database. If you can write the logs to a different mount point. that can isolate that IO from the database. For trending other things, I'd recommend starting with something like Prometheus (https://prometheus.io/) & Grafana (https://grafana.com/). Get an exporter set up (sql_exporter is a good one - https://github.com/burningalchemist/sql_exporter) and set up alerts and trending your metrics so you can go back and look at history when those alerts fire. If you need to start scaling bigger, then you can start looking into something like Datadog and since you'll already have a better idea of what you actually need to monitor by then, it won't seem nearly as overwhelming jumping to something like that. Keith On Fri, Apr 10, 2026 at 1:49=E2=80=AFPM mahamood hussain wrote: > Hi Team, > > We are currently working on a migration project from DB2 to PostgreSQL. > Post-migration, we=E2=80=99re observing several performance issues such a= s > long-running queries and occasional instance crashes. It also appears tha= t > some application-side workloads may not be optimized for PostgreSQL. > > From a DBA perspective, I=E2=80=99m looking to proactively identify probl= em > areas=E2=80=94such as: > > - Long-running queries > - Jobs/stored procedures consuming high temp space > - Queries resulting in sequential scans due to missing indexes > - Lock waits, deadlocks, and memory-heavy operations > > We already have key parameters enabled (pg_stat_statements, pg_buffercach= e, > etc.), and PostgreSQL is generating logs in .csv format. However, the > main challenge is efficiently analyzing these logs and identifying > performance bottlenecks at scale (databases ranging from ~1TB to 15TB). > > We currently don=E2=80=99t have third-party monitoring tools like Datadog= , so I=E2=80=99m > looking for *recommendations on free or lightweight tools* and best > practices to: > > - Parse and analyze PostgreSQL logs (especially CSV logs) > - Identify top resource-consuming queries and patterns > - Correlate temp usage, memory pressure, and query behavior > - Generate actionable insights for the engineering team > > Any suggestions on tools, scripts, or approaches that have worked well in > similar large-scale environments would be greatly appreciated. > --000000000000e82be2064f1f63f4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
For log analysis, pgbadger (https://pgbadger.darold.net/) is the = best tool I've come across. Just be sure to adjust your log_line_prefix= to include information such as client host/IP, role, database and error co= des. Turn on other settings such as logging checkpointing, temp file genera= tion and locking. The more you log, the more that pgbadger can help analyze= . Just keep an eye on your log generation since you don't want that to = in turn affect your database. If you can write the logs to a different moun= t point. that can isolate that IO from the database.

For trending other things, I'd recommend starting with something lik= e Prometheus (https://prometheus.io/= ) & Grafana (https://grafana.com/)= . Get an exporter set up (sql_exporter is a good one -=C2=A0https://github.com/burningalc= hemist/sql_exporter) and set up alerts and trending your metrics so you= can go back and look at history when those alerts fire. If you need to sta= rt scaling bigger, then you can start looking into something like Datadog a= nd since you'll already have a better idea of what you actually need to= monitor by then, it won't seem nearly as overwhelming jumping to somet= hing like that.

Keith

O= n Fri, Apr 10, 2026 at 1:49=E2=80=AFPM mahamood hussain <hussain.ieg@gmail.com> wrote:

Hi Team,=

We are currently working on a migration project from DB2 to PostgreSQL. = Post-migration, we=E2=80=99re observing several performance issues such as = long-running queries and occasional instance crashes. It also appears that = some application-side workloads may not be optimized for PostgreSQL.

From a DBA perspective, I=E2=80=99m looking to proactively identify prob= lem areas=E2=80=94such as:

  • Long-running queries
  • Jobs/stored procedures consuming high temp space
  • Queries resulting in sequential scans due to missing indexes
  • Lock waits, deadlocks, and memory-heavy operations

We already have key parameters enabled (pg_stat_statements,= pg_buffercache, etc.), and PostgreSQL is generating logs in <= code>.csv format. However, the main challenge is efficiently analyzi= ng these logs and identifying performance bottlenecks at scale (databases r= anging from ~1TB to 15TB).

We currently don=E2=80=99t have third-party monitoring tools like Datado= g, so I=E2=80=99m looking for recommendations on free or lightweight too= ls and best practices to:

  • Parse and analyze PostgreSQL logs (especially CSV logs)
  • Identify top resource-consuming queries and patterns
  • Correlate temp usage, memory pressure, and query behavior
  • Generate actionable insights for the engineering team

Any suggestions on tools, scripts, or approaches that have worked well i= n similar large-scale environments would be greatly appreciated.

--000000000000e82be2064f1f63f4--