Skip to content

Commit 7c551e3

Browse files
authored
Merge pull request #278936 from varun-dhawan/varund-jul
[PostgreSQL] doc corrections
2 parents f96ab20 + 5f98ea0 commit 7c551e3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

articles/postgresql/flexible-server/how-to-optimize-query-stats-collection.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ title: Optimize query stats collection
33
description: This article describes how you can optimize query stats collection on Azure Database for PostgreSQL - Flexible Server.
44
author: assaff
55
ms.author: assaff
6-
ms.reviewer: maghan
7-
ms.date: 04/27/2024
6+
ms.date: 06/21/2024
87
ms.service: postgresql
98
ms.subservice: flexible-server
109
ms.topic: how-to
@@ -14,18 +13,21 @@ ms.topic: how-to
1413

1514
[!INCLUDE [applies-to-postgresql-flexible-server](~/reusable-content/ce-skilling/azure/includes/postgresql/includes/applies-to-postgresql-flexible-server.md)]
1615

17-
This article describes how to optimize query statistics collection on an Azure Database for PostgreSQL flexible server instance.
16+
This article describes how to optimize query statistics collection on an Azure Database for PostgreSQL flexible server using pg_stat_statements extension
1817

1918
## Use pg_stat_statements
2019

2120
**Pg_stat_statements** is a PostgreSQL extension that can be enabled in Azure Database for PostgreSQL flexible server. The extension provides a means to track execution statistics for all SQL statements executed by a server. This module hooks into every query execution and comes with a non-trivial performance cost. Enabling **pg_stat_statements** forces query text writes to files on disk.
2221

23-
If you have unique queries with long query text or you don't actively monitor **pg_stat_statements**, disable **pg_stat_statements** for best performance. To do so, change the setting to `pg_stat_statements.track = NONE`.
22+
> [!NOTE]
23+
> `pg_stat_statements.track` is by default to NONE (i.e. disabled).
2424
25-
To set `pg_stat_statements.track = NONE`:
25+
If you want to start tracking the execution statistics of all SQL statements executed by a server, then enable **pg_stat_statements**. To do so, set the value to `TOP` or `ALL`, depending on whether you want to track top-level queries or also nested queries (those executed inside a function or procedure).
26+
27+
To set **pg_stat_statements.track** = `TOP`
2628

2729
- In the Azure portal, go to the [Azure Database for PostgreSQL flexible server resource management page and select the server parameters blade](concepts-server-parameters.md).
28-
- Use the [Azure CLI](connect-azure-cli.md) az postgres server configuration set to `--name pg_stat_statements.track --resource-group myresourcegroup --server mydemoserver --value NONE`.
30+
- Use the [Azure CLI](connect-azure-cli.md) az postgres server configuration set to `--name pg_stat_statements.track --resource-group myresourcegroup --server mydemoserver --value TOP`.
2931

3032
## Use the Query Store
3133

0 commit comments

Comments
 (0)