pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Harish Harish <hpt3009@gmail.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Missing indexes
Date: Sat, 02 Mar 2024 11:24:00 +0100
Message-ID: <b26e1dff5d309c6bdb1bcacf568b9f991ea24242.camel@cybertec.at> (raw)
In-Reply-To: <CANc-nPuFe-HmHCfwQfgcvbrSbmgcxmT2Q0H4nUqqZNuy2tFRdw@mail.gmail.com>
References: <CANc-nPuFe-HmHCfwQfgcvbrSbmgcxmT2Q0H4nUqqZNuy2tFRdw@mail.gmail.com>

On Fri, 2024-03-01 at 22:07 +0530, Harish Harish wrote:
> I need help. We are on Postgres 10. and have a feeling there are some indexes missing wich is causing performance issue
> 
> Please help me find the missing index within  PostgreSQl 10.

Three pointers:

1. upgrade to v16

2. activate pg_stat_statements and look for the statements that consume most time:

   SELECT total_exec_time, calls, query
   FROM pg_stat_statements
   ORDER BY total_exec_time DESC
   LIMIT 10;

3. Look for frequent large sequential scans

   SELECT relid::regclass AS table_name,
          seq_scan AS sequential_scans,
          seq_tup_read / seq_scan AS scan_size
   FROM pg_stat_user_tables
   WHERE seq_scan > 0
   ORDER BY least(seq_scan, seq_tup_read / seq_scan) DESC
   LIMIT 10;

Yours,
Laurenz Albe





view thread (7+ messages)  latest in thread

Message-ID: <b26e1dff5d309c6bdb1bcacf568b9f991ea24242.camel@cybertec.at>
Permalink:  ../b26e1dff5d309c6bdb1bcacf568b9f991ea24242.camel@cybertec.at/
Also on:    postgresql.org/message-id/b26e1dff5d309c6bdb1bcacf568b9f991ea24242.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, hpt3009@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Missing indexes
  In-Reply-To: <b26e1dff5d309c6bdb1bcacf568b9f991ea24242.camel@cybertec.at>

* 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