From mailinglists at geldenhuys.co.uk Sat Sep 25 16:00:03 2021 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Sat, 25 Sep 2021 15:00:03 +0100 Subject: [fpc-other] PostgreSQL index tuning Message-ID: <25b28bce-5de0-e186-ab3c-0d045a764b2f@geldenhuys.co.uk> Hi, Does anybody know if there is a tool I could use to analyse queries to a PostgreSQL database, so I could tune it's performance. eg: detect table scans in the execution plan, suggest creating, dropping or altering indexes etc. MS SQL server comes with loads of tools and options to do this, but I'm fairly new to using PostgreSQL as the data store, so not sure what tools are out there. Any suggestions would me much appreciated. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp From fpc at pascalprogramming.org Sat Sep 25 16:19:25 2021 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Sat, 25 Sep 2021 16:19:25 +0200 Subject: [fpc-other] PostgreSQL index tuning In-Reply-To: <25b28bce-5de0-e186-ab3c-0d045a764b2f@geldenhuys.co.uk> References: <25b28bce-5de0-e186-ab3c-0d045a764b2f@geldenhuys.co.uk> Message-ID: <934422b1-ede1-90a8-517e-13bec16d068e@pascalprogramming.org> Op 25-9-2021 om 16:00 schreef Graeme Geldenhuys via fpc-other: > Does anybody know if there is a tool I could use to analyse queries to a > PostgreSQL database, so I could tune it's performance. eg: detect table > scans in the execution plan, suggest creating, dropping or altering indexes > etc. > > MS SQL server comes with loads of tools and options to do this, but I'm > fairly new to using PostgreSQL as the data store, so not sure what tools > are out there. Any suggestions would me much appreciated. > The default postgres admin too "pgadmin" seems to have some query analysis that yields plan insights according to https://www.pgadmin.org/docs/pgadmin4/5.2/query_tool.html From lazarus at mfriebe.de Sat Sep 25 16:21:39 2021 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 25 Sep 2021 16:21:39 +0200 Subject: [fpc-other] PostgreSQL index tuning In-Reply-To: <25b28bce-5de0-e186-ab3c-0d045a764b2f@geldenhuys.co.uk> References: <25b28bce-5de0-e186-ab3c-0d045a764b2f@geldenhuys.co.uk> Message-ID: <738977a9-fea1-c32c-5563-28ad394cc883@mfriebe.de> On 25/09/2021 16:00, Graeme Geldenhuys via fpc-other wrote: > Hi, > > Does anybody know if there is a tool I could use to analyse queries to a > PostgreSQL database, so I could tune it's performance. eg: detect table > scans in the execution plan, suggest creating, dropping or altering indexes > etc. > > MS SQL server comes with loads of tools and options to do this, but I'm > fairly new to using PostgreSQL as the data store, so not sure what tools > are out there. Any suggestions would me much appreciated. > For individual queries https://www.postgresql.org/docs/current/using-explain.html To watch a running server (via logfile) https://www.postgresql.org/docs/current/auto-explain.html and I think pgAdmin has some nice visualization https://www.pgadmin.org/ https://www.pgadmin.org/screenshots/#10 From fpc at mfriebe.de Sat Sep 25 16:23:23 2021 From: fpc at mfriebe.de (Martin) Date: Sat, 25 Sep 2021 16:23:23 +0200 Subject: [fpc-other] PostgreSQL index tuning In-Reply-To: <25b28bce-5de0-e186-ab3c-0d045a764b2f@geldenhuys.co.uk> References: <25b28bce-5de0-e186-ab3c-0d045a764b2f@geldenhuys.co.uk> Message-ID: <16f3a935-bc67-650f-1858-19baf430898e@mfriebe.de> On 25/09/2021 16:00, Graeme Geldenhuys via fpc-other wrote: > Hi, > > Does anybody know if there is a tool I could use to analyse queries to a > PostgreSQL database, so I could tune it's performance. eg: detect table > scans in the execution plan, suggest creating, dropping or altering indexes > etc. > > MS SQL server comes with loads of tools and options to do this, but I'm > fairly new to using PostgreSQL as the data store, so not sure what tools > are out there. Any suggestions would me much appreciated. > For individual queries https://www.postgresql.org/docs/current/using-explain.html To watch a running server (via logfile) https://www.postgresql.org/docs/current/auto-explain.html and I think pgAdmin has some nice visualization https://www.pgadmin.org/ https://www.pgadmin.org/screenshots/#10