Deprecated: Function Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional::get_feature_flag is deprecated since version Yoast SEO 20.5 with no alternative available. in /home1/minerho3/public_html/wp-includes/functions.php on line 6078

Deprecated: Function Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional::get_feature_flag is deprecated since version Yoast SEO 20.5 with no alternative available. in /home1/minerho3/public_html/wp-includes/functions.php on line 6078

Deprecated: Function Yoast\WP\SEO\Conditionals\Schema_Blocks_Conditional::get_feature_flag is deprecated since version Yoast SEO 20.5 with no alternative available. in /home1/minerho3/public_html/wp-includes/functions.php on line 6078

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/minerho3/public_html/wp-includes/functions.php:6078) in /home1/minerho3/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":4351,"date":"2020-08-23T11:05:33","date_gmt":"2020-08-23T11:05:33","guid":{"rendered":"http:\/\/minervadb.com\/?p=4351"},"modified":"2020-08-24T09:21:47","modified_gmt":"2020-08-24T09:21:47","slug":"troubleshooting-postgresql-performance-from-slow-queries","status":"publish","type":"post","link":"https:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/","title":{"rendered":"Troubleshooting PostgreSQL Performance from Slow Queries"},"content":{"rendered":"

PostgreSQL Performance Troubleshooting with Slow Queries<\/span><\/h1>\n
\n
\n

Introduction \u00a0<\/span><\/h4>\n

If you are doing a very detailed Performance Diagnostics \/ Forensics then we strongly recommend you to understand the Data Access Path of underlying queries, cost of query execution, wait events \/ locks and system resource usage by PostgreSQL infrastructure operations. MinervaDB Performance Engineering Team measures performance by “Response Time<\/strong>” , So finding slow queries in PostgreSQL will be the most appropriate point to start this blog. PostgreSQL Server is highly configurable to collect details on query performance: slow query log, auditing execution plans with auto_explain<\/em> and querying pg_stat_statements\u00a0<\/em><\/strong>\u00a0.\u00a0<\/span><\/p>\n

Using PostgreSQL slow query log to troubleshoot the performance<\/h4>\n

Step 1<\/strong> – Open\u00a0postgresql.conf<\/strong> file in your favorite text editor ( In Ubuntu, postgreaql.conf is available on \/etc\/postgresql\/ ) and update configuration parameter log_min_duration_statement , <\/em>By\u00a0default configuration the slow query log is not active, To enable the slow query log on globally, you can change postgresql.conf:<\/p>\n

log_min_duration_statement = 2000<\/pre>\n

In the above configuration, PostgreSQL will log queries, which take longer than 2 seconds.<\/p>\n

Step 2<\/strong> – A “reload” (by\u00a0simply calling the SQL function) is sufficient, there is no need for a PostgreSQL server restart and Don\u2019t worry, it won\u2019t interrupt any active connections<\/em>:<\/p>\n

postgres=# SELECT pg_reload_conf();\r\n pg_reload_conf \r\n----------------\r\n t \r\n(1 row)<\/pre>\n

Note: It’s often too heavy for PostgreSQL infrastructure if you change slow query log settings in postgresql.conf , Therefore it makes more sensible to change only for a selected database or user:<\/em><\/p>\n

postgres=# ALTER DATABASE minervadb SET log_min_duration_statement = 2000;\r\nALTER DATABASE<\/pre>\n

To complete the detailed performance forensics \/ diagnostics of high latency queries you can use aut0_explain , We have explained same below for queries exceeding certain threshold in PostgreSQL to send plan to the log file:<\/p>\n

postgres=# LOAD 'auto_explain';\r\nLOAD\r\npostgres=# SET auto_explain.log_analyze TO on;\r\nSET\r\npostgres=# SET auto_explain.log_min_duration TO 2000;\r\nSET<\/pre>\n

You can also enable auto explain in postgresql.conf with the settings below:<\/p>\n

session_preload_libraries = 'auto_explain';<\/pre>\n

Note: Please do not forget to call pg_reload_conf() after the change made to postgresql.conf<\/em><\/p>\n

More examples on PostgreSQL auto explain is copied below:<\/p>\n

postgres=# CREATE TABLE minervdb_bench  AS\r\npostgres-# SELECT * FROM generate_series(1, 10000000) AS id;\r\nSELECT 10000000\r\npostgres=# CREATE INDEX idx_id ON minervadb_bench(id);\r\n\r\npostgres=# CREATE INDEX idx_id ON minervdb_bench(id);\r\nCREATE INDEX\r\npostgres=# ANALYZE;\r\nANALYZE\r\n\r\npostgres=# LOAD 'auto_explain';\r\nLOAD\r\npostgres=# SET auto_explain.log_analyze TO on;\r\nSET\r\npostgres=# SET auto_explain.log_min_duration TO 200;\r\nSET\r\n\r\npostgres=# explain SELECT * FROM minervdb_bench  WHERE id < 5000;\r\n                                      QUERY PLAN                                       \r\n---------------------------------------------------------------------------------------\r\n Index Only Scan using idx_id on minervdb_bench  (cost=0.43..159.25 rows=4732 width=4)\r\n   Index Cond: (id < 5000)\r\n(2 rows)\r\n\r\npostgres=# explain SELECT * FROM minervdb_bench  WHERE id < 200000;\r\n                                        QUERY PLAN                                        \r\n------------------------------------------------------------------------------------------\r\n Index Only Scan using idx_id on minervdb_bench  (cost=0.43..6550.25 rows=198961 width=4)\r\n   Index Cond: (id < 200000)\r\n(2 rows)\r\n\r\npostgres=# explain SELECT count(*) FROM minervdb_bench GROUP BY id % 2;\r\n                                     QUERY PLAN                                      \r\n-------------------------------------------------------------------------------------\r\n GroupAggregate  (cost=1605360.71..1805360.25 rows=9999977 width=12)\r\n   Group Key: ((id % 2))\r\n   ->  Sort  (cost=1605360.71..1630360.65 rows=9999977 width=4)\r\n         Sort Key: ((id % 2))\r\n         ->  Seq Scan on minervdb_bench  (cost=0.00..169247.71 rows=9999977 width=4)\r\n JIT:\r\n   Functions: 6\r\n   Options: Inlining true, Optimization true, Expressions true, Deforming true\r\n(8 rows)\r\n<\/pre>\n

Using pg_stat_statements<\/h3>\n

We can use pg_stat_statements to group the identical PostgreSQL queries by latency, To enable pg_stat_statements you have to add the following line to postgresql.conf and restart PostgreSQL server:<\/p>\n

# postgresql.conf\r\nshared_preload_libraries = 'pg_stat_statements'\r\n\r\npg_stat_statements.max = 10000\r\npg_stat_statements.track = all<\/pre>\n

Run \u201cCREATE EXTENSION pg_stat_statements\u201d in your database so that PostgreSQL will create a view for you:<\/p>\n

postgres=# CREATE EXTENSION pg_stat_statements;\r\nCREATE EXTENSION\r\n\r\npostgres=# \\d pg_stat_statements\r\n                    View \"public.pg_stat_statements\"\r\n       Column        |       Type       | Collation | Nullable | Default \r\n---------------------+------------------+-----------+----------+---------\r\n userid              | oid              |           |          | \r\n dbid                | oid              |           |          | \r\n queryid             | bigint           |           |          | \r\n query               | text             |           |          | \r\n calls               | bigint           |           |          | \r\n total_time          | double precision |           |          | \r\n min_time            | double precision |           |          | \r\n max_time            | double precision |           |          | \r\n mean_time           | double precision |           |          | \r\n stddev_time         | double precision |           |          | \r\n rows                | bigint           |           |          | \r\n shared_blks_hit     | bigint           |           |          | \r\n shared_blks_read    | bigint           |           |          | \r\n shared_blks_dirtied | bigint           |           |          | \r\n shared_blks_written | bigint           |           |          | \r\n local_blks_hit      | bigint           |           |          | \r\n local_blks_read     | bigint           |           |          | \r\n local_blks_dirtied  | bigint           |           |          | \r\n local_blks_written  | bigint           |           |          | \r\n temp_blks_read      | bigint           |           |          | \r\n temp_blks_written   | bigint           |           |          | \r\n blk_read_time       | double precision |           |          | \r\n blk_write_time      | double precision |           |          | \r\n\r\npostgres=#<\/pre>\n

pg_stat_statements <\/strong>view\u00a0columns explained (Source: https:\/\/www.postgresql.org\/docs\/12\/pgstatstatements.html<\/a><\/span>)<\/p>\n

\n\n\n\n\n\n<\/colgroup>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Name<\/th>\nType<\/th>\nReferences<\/th>\nDescription<\/th>\n<\/tr>\n<\/thead>\n
userid<\/td>\noid<\/td>\npg_authid.oid<\/td>\nOID of user who executed the statement<\/td>\n<\/tr>\n
dbid<\/td>\noid<\/td>\npg_database.oid<\/td>\nOID of database in which the statement was executed<\/td>\n<\/tr>\n
queryid<\/td>\nbigint<\/td>\n<\/td>\nInternal hash code, computed from the statement’s parse tree<\/td>\n<\/tr>\n
query<\/td>\ntext<\/td>\n<\/td>\nText of a representative statement<\/td>\n<\/tr>\n
calls<\/td>\nbigint<\/td>\n<\/td>\nNumber of times executed<\/td>\n<\/tr>\n
total_time<\/td>\ndouble precision<\/td>\n<\/td>\nTotal time spent in the statement, in milliseconds<\/td>\n<\/tr>\n
min_time<\/td>\ndouble precision<\/td>\n<\/td>\nMinimum time spent in the statement, in milliseconds<\/td>\n<\/tr>\n
max_time<\/td>\ndouble precision<\/td>\n<\/td>\nMaximum time spent in the statement, in milliseconds<\/td>\n<\/tr>\n
mean_time<\/td>\ndouble precision<\/td>\n<\/td>\nMean time spent in the statement, in milliseconds<\/td>\n<\/tr>\n
stddev_time<\/td>\ndouble precision<\/td>\n<\/td>\nPopulation standard deviation of time spent in the statement, in milliseconds<\/td>\n<\/tr>\n
rows<\/td>\nbigint<\/td>\n<\/td>\nTotal number of rows retrieved or affected by the statement<\/td>\n<\/tr>\n
shared_blks_hit<\/td>\nbigint<\/td>\n<\/td>\nTotal number of shared block cache hits by the statement<\/td>\n<\/tr>\n
shared_blks_read<\/td>\nbigint<\/td>\n<\/td>\nTotal number of shared blocks read by the statement<\/td>\n<\/tr>\n
shared_blks_dirtied<\/td>\nbigint<\/td>\n<\/td>\nTotal number of shared blocks dirtied by the statement<\/td>\n<\/tr>\n
shared_blks_written<\/td>\nbigint<\/td>\n<\/td>\nTotal number of shared blocks written by the statement<\/td>\n<\/tr>\n
local_blks_hit<\/td>\nbigint<\/td>\n<\/td>\nTotal number of local block cache hits by the statement<\/td>\n<\/tr>\n
local_blks_read<\/td>\nbigint<\/td>\n<\/td>\nTotal number of local blocks read by the statement<\/td>\n<\/tr>\n
local_blks_dirtied<\/td>\nbigint<\/td>\n<\/td>\nTotal number of local blocks dirtied by the statement<\/td>\n<\/tr>\n
local_blks_written<\/td>\nbigint<\/td>\n<\/td>\nTotal number of local blocks written by the statement<\/td>\n<\/tr>\n
temp_blks_read<\/td>\nbigint<\/td>\n<\/td>\nTotal number of temp blocks read by the statement<\/td>\n<\/tr>\n
temp_blks_written<\/td>\nbigint<\/td>\n<\/td>\nTotal number of temp blocks written by the statement<\/td>\n<\/tr>\n
blk_read_time<\/td>\ndouble precision<\/td>\n<\/td>\nTotal time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)<\/td>\n<\/tr>\n
blk_write_time<\/td>\ndouble precision<\/td>\n<\/td>\nTotal time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

You can list queries by latency \/ Response Time in PostgreSQL \u00a0by querying\u00a0pg_stat_statements<\/em>:<\/p>\n

postgres=# \\x\r\nExpanded display is on.\r\n\r\nselect query,calls,total_time,min_time,max_time,mean_time,stddev_time,rows from pg_stat_statements order by mean_time desc;\r\n\r\n-[ RECORD 1 ]---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\nquery       | SELECT count(*) FROM minervdb_bench GROUP BY id % $1\r\ncalls       | 6\r\ntotal_time  | 33010.533078\r\nmin_time    | 4197.876021\r\nmax_time    | 6485.33594\r\nmean_time   | 5501.755512999999\r\nstddev_time | 826.3716429081501\r\nrows        | 72\r\n-[ RECORD 2 ]---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\nquery       | CREATE INDEX idx_id ON minervdb_bench(id)\r\ncalls       | 1\r\ntotal_time  | 4560.808456\r\nmin_time    | 4560.808456\r\nmax_time    | 4560.808456\r\nmean_time   | 4560.808456\r\nstddev_time | 0\r\nrows        | 0\r\n-[ RECORD 3 ]---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\nquery       | ANALYZE\r\ncalls       | 1\r\ntotal_time  | 441.725223\r\nmin_time    | 441.725223\r\nmax_time    | 441.725223\r\nmean_time   | 441.725223\r\nstddev_time | 0\r\nrows        | 0\r\n\r\n-[ RECORD 4 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n------------------------------------------------------------------------------------------------------------------------------------------------\r\nquery       | SELECT a.attname,                                                                                                                                                         \r\n                                                                                                                                                +\r\n            |   pg_catalog.format_type(a.atttypid, a.atttypmod),                                                                                                                        \r\n                                                                                                                                                +\r\n            |   (SELECT substring(pg_catalog.pg_get_expr(d.adbin, d.adrelid, $1) for $2)                                                                                                                                                                                                                                                +\r\n            |    FROM pg_catalog.pg_attrdef d                                                                                                                                                                                                                                                                                           +\r\n            |    WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef),                                                                                                                                                                                                                                                  +\r\n            |   a.attnotnull,                                                                                                                                                                                                                                                                                                           +\r\n            |   (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type t                                                                                                                                                                                                                                                 +\r\n            |    WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation) AS attcollation,                                                                                                                                                                                                             +\r\n            |   a.attidentity,                                                                                                                                                                                                                                                                                                          +\r\n            |   a.attgenerated                                                                                                                                                                                                                                                                                                          +\r\n            | FROM pg_catalog.pg_attribute a                                                                                                                                                                                                                                                                                            +\r\n            | WHERE a.attrelid = $3 AND a.attnum > $4 AND NOT a.attisdropped                                                                                                                                                                                                                                                            +\r\n            | ORDER BY a.attnum\r\ncalls       | 4\r\ntotal_time  | 1.053107\r\nmin_time    | 0.081565\r\nmax_time    | 0.721785\r\nmean_time   | 0.26327675000000006\r\nstddev_time | 0.2658756938743884\r\nrows        | 86\r\n<\/pre>\n

If you already know the epicenter of the bottleneck is a particular query or event \/ time, you can reset statistics just before query \/ event to monitor the problematic components in the PostgreSQL performance, You can do that by just calling pg_stat_statements_reset() <\/em>as copied\u00a0below:<\/p>\n

postgres= SELECT pg_stat_statements_reset();<\/pre>\n

Conclusion<\/b><\/h2>\n

Performance tuning<\/b> is the process of optimizing PostgreSQL\u00a0performance <\/strong>by streamlining the execution of multiple SQL statements. In other words, performance tuning\u00a0<\/b>simplifies the process of accessing and altering information contained by the database with the intention of improving query response times and database application operations.<\/p>\n

\"\"<\/a><\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

PostgreSQL Performance Troubleshooting with Slow Queries Introduction \u00a0 If you are doing a very detailed Performance Diagnostics \/ Forensics then we strongly recommend you to understand the Data Access Path of underlying queries, cost of […]<\/a><\/p>\n<\/div>","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2309,6476,2368],"tags":[2292,6477,2293],"yoast_head":"\nTroubleshooting PostgreSQL Performance from Slow Queries<\/title>\n<meta name=\"description\" content=\"Troubleshooting PostgreSQL Performance from Slow Queries - PostgreSQL Performance Tuning - PostgreSQL Consulting - PostgreSQL Support\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Troubleshooting PostgreSQL Performance from Slow Queries\" \/>\n<meta property=\"og:description\" content=\"Troubleshooting PostgreSQL Performance from Slow Queries - PostgreSQL Performance Tuning - PostgreSQL Consulting - PostgreSQL Support\" \/>\n<meta property=\"og:url\" content=\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/\" \/>\n<meta property=\"og:site_name\" content=\"The WebScale Database Infrastructure Operations Experts\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/WebScaleDBA\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/WebScaleDBA\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-23T11:05:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-24T09:21:47+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png\" \/>\n<meta name=\"author\" content=\"MinervaDB Corporation\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/WebScaleDBA\" \/>\n<meta name=\"twitter:site\" content=\"@webscaledba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"MinervaDB Corporation\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/\"},\"author\":{\"name\":\"MinervaDB Corporation\",\"@id\":\"https:\/\/minervadb.com\/#\/schema\/person\/9cae1c69d8b5c86168963f97bf75b9ce\"},\"headline\":\"Troubleshooting PostgreSQL Performance from Slow Queries\",\"datePublished\":\"2020-08-23T11:05:33+00:00\",\"dateModified\":\"2020-08-24T09:21:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/\"},\"wordCount\":797,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/minervadb.com\/#organization\"},\"image\":{\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png\",\"keywords\":[\"PostgreSQL\",\"PostgreSQL DBA\",\"PostgreSQL Performance\"],\"articleSection\":[\"PostgreSQL\",\"PostgreSQL DBA\",\"PostgreSQL Performance\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/\",\"url\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/\",\"name\":\"Troubleshooting PostgreSQL Performance from Slow Queries\",\"isPartOf\":{\"@id\":\"https:\/\/minervadb.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png\",\"datePublished\":\"2020-08-23T11:05:33+00:00\",\"dateModified\":\"2020-08-24T09:21:47+00:00\",\"description\":\"Troubleshooting PostgreSQL Performance from Slow Queries - PostgreSQL Performance Tuning - PostgreSQL Consulting - PostgreSQL Support\",\"breadcrumb\":{\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage\",\"url\":\"https:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png\",\"contentUrl\":\"https:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png\",\"width\":2202,\"height\":1612},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/minervadb.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Troubleshooting PostgreSQL Performance from Slow Queries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/minervadb.com\/#website\",\"url\":\"https:\/\/minervadb.com\/\",\"name\":\"The WebScale Database Infrastructure Operations Experts\",\"description\":\"Committed to Building Optimal, Scalable, Highly Available, Fault-Tolerant, Reliable and Secured WebScale Database Infrastructure Operations\",\"publisher\":{\"@id\":\"https:\/\/minervadb.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/minervadb.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/minervadb.com\/#organization\",\"name\":\"MinervaDB\",\"url\":\"https:\/\/minervadb.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/minervadb.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/minervadb.com\/wp-content\/uploads\/2018\/03\/LogoColorTextRight.jpeg\",\"contentUrl\":\"https:\/\/minervadb.com\/wp-content\/uploads\/2018\/03\/LogoColorTextRight.jpeg\",\"width\":200,\"height\":200,\"caption\":\"MinervaDB\"},\"image\":{\"@id\":\"https:\/\/minervadb.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/WebScaleDBA\/\",\"https:\/\/x.com\/webscaledba\",\"https:\/\/www.linkedin.com\/company\/minervadb\/\",\"https:\/\/www.youtube.com\/channel\/UClLrz7wS8gVyAR8Lf5x7r1g?view_as=subscriber\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/minervadb.com\/#\/schema\/person\/9cae1c69d8b5c86168963f97bf75b9ce\",\"name\":\"MinervaDB Corporation\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/minervadb.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0d00cba8b96118c4c4ed6d6be8f771ce?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0d00cba8b96118c4c4ed6d6be8f771ce?s=96&d=blank&r=g\",\"caption\":\"MinervaDB Corporation\"},\"description\":\"Independent and vendor neutral consulting, support, remote DBA services and training for MySQL, MariaDB, Percona Server, PostgreSQL and ClickHouse with core expertize in performance, scalability and high availability . We are an virtual corporation, all of us work from home on multiple timezones and stay connected via Email, Skype, Google Hangouts, Phone and IRC supporting over 250 customers worldwide\",\"sameAs\":[\"https:\/\/minervadb.com\",\"https:\/\/www.facebook.com\/WebScaleDBA\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/WebScaleDBA\"],\"url\":\"https:\/\/minervadb.com\/index.php\/author\/minervadb\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Troubleshooting PostgreSQL Performance from Slow Queries","description":"Troubleshooting PostgreSQL Performance from Slow Queries - PostgreSQL Performance Tuning - PostgreSQL Consulting - PostgreSQL Support","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/","og_locale":"en_US","og_type":"article","og_title":"Troubleshooting PostgreSQL Performance from Slow Queries","og_description":"Troubleshooting PostgreSQL Performance from Slow Queries - PostgreSQL Performance Tuning - PostgreSQL Consulting - PostgreSQL Support","og_url":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/","og_site_name":"The WebScale Database Infrastructure Operations Experts","article_publisher":"https:\/\/www.facebook.com\/WebScaleDBA\/","article_author":"https:\/\/www.facebook.com\/WebScaleDBA\/","article_published_time":"2020-08-23T11:05:33+00:00","article_modified_time":"2020-08-24T09:21:47+00:00","og_image":[{"url":"http:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png"}],"author":"MinervaDB Corporation","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/WebScaleDBA","twitter_site":"@webscaledba","twitter_misc":{"Written by":"MinervaDB Corporation","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#article","isPartOf":{"@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/"},"author":{"name":"MinervaDB Corporation","@id":"https:\/\/minervadb.com\/#\/schema\/person\/9cae1c69d8b5c86168963f97bf75b9ce"},"headline":"Troubleshooting PostgreSQL Performance from Slow Queries","datePublished":"2020-08-23T11:05:33+00:00","dateModified":"2020-08-24T09:21:47+00:00","mainEntityOfPage":{"@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/"},"wordCount":797,"commentCount":0,"publisher":{"@id":"https:\/\/minervadb.com\/#organization"},"image":{"@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage"},"thumbnailUrl":"http:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png","keywords":["PostgreSQL","PostgreSQL DBA","PostgreSQL Performance"],"articleSection":["PostgreSQL","PostgreSQL DBA","PostgreSQL Performance"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/","url":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/","name":"Troubleshooting PostgreSQL Performance from Slow Queries","isPartOf":{"@id":"https:\/\/minervadb.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage"},"image":{"@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage"},"thumbnailUrl":"http:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png","datePublished":"2020-08-23T11:05:33+00:00","dateModified":"2020-08-24T09:21:47+00:00","description":"Troubleshooting PostgreSQL Performance from Slow Queries - PostgreSQL Performance Tuning - PostgreSQL Consulting - PostgreSQL Support","breadcrumb":{"@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#primaryimage","url":"https:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png","contentUrl":"https:\/\/minervadb.com\/wp-content\/uploads\/2020\/08\/MDBPostgreSQL.png","width":2202,"height":1612},{"@type":"BreadcrumbList","@id":"http:\/\/minervadb.com\/index.php\/2020\/08\/23\/troubleshooting-postgresql-performance-from-slow-queries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/minervadb.com\/"},{"@type":"ListItem","position":2,"name":"Troubleshooting PostgreSQL Performance from Slow Queries"}]},{"@type":"WebSite","@id":"https:\/\/minervadb.com\/#website","url":"https:\/\/minervadb.com\/","name":"The WebScale Database Infrastructure Operations Experts","description":"Committed to Building Optimal, Scalable, Highly Available, Fault-Tolerant, Reliable and Secured WebScale Database Infrastructure Operations","publisher":{"@id":"https:\/\/minervadb.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/minervadb.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/minervadb.com\/#organization","name":"MinervaDB","url":"https:\/\/minervadb.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/minervadb.com\/#\/schema\/logo\/image\/","url":"https:\/\/minervadb.com\/wp-content\/uploads\/2018\/03\/LogoColorTextRight.jpeg","contentUrl":"https:\/\/minervadb.com\/wp-content\/uploads\/2018\/03\/LogoColorTextRight.jpeg","width":200,"height":200,"caption":"MinervaDB"},"image":{"@id":"https:\/\/minervadb.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/WebScaleDBA\/","https:\/\/x.com\/webscaledba","https:\/\/www.linkedin.com\/company\/minervadb\/","https:\/\/www.youtube.com\/channel\/UClLrz7wS8gVyAR8Lf5x7r1g?view_as=subscriber"]},{"@type":"Person","@id":"https:\/\/minervadb.com\/#\/schema\/person\/9cae1c69d8b5c86168963f97bf75b9ce","name":"MinervaDB Corporation","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/minervadb.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0d00cba8b96118c4c4ed6d6be8f771ce?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0d00cba8b96118c4c4ed6d6be8f771ce?s=96&d=blank&r=g","caption":"MinervaDB Corporation"},"description":"Independent and vendor neutral consulting, support, remote DBA services and training for MySQL, MariaDB, Percona Server, PostgreSQL and ClickHouse with core expertize in performance, scalability and high availability . We are an virtual corporation, all of us work from home on multiple timezones and stay connected via Email, Skype, Google Hangouts, Phone and IRC supporting over 250 customers worldwide","sameAs":["https:\/\/minervadb.com","https:\/\/www.facebook.com\/WebScaleDBA\/","https:\/\/x.com\/https:\/\/twitter.com\/WebScaleDBA"],"url":"https:\/\/minervadb.com\/index.php\/author\/minervadb\/"}]}},"_links":{"self":[{"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/posts\/4351"}],"collection":[{"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/comments?post=4351"}],"version-history":[{"count":30,"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/posts\/4351\/revisions"}],"predecessor-version":[{"id":4422,"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/posts\/4351\/revisions\/4422"}],"wp:attachment":[{"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/media?parent=4351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/categories?post=4351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/minervadb.com\/index.php\/wp-json\/wp\/v2\/tags?post=4351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}