GithubHelp home page GithubHelp logo

dalibo / pev2 Goto Github PK

View Code? Open in Web Editor NEW
2.4K 28.0 111.0 9.02 MB

Postgres Explain Visualizer 2

Home Page: https://explain.dalibo.com

License: PostgreSQL License

JavaScript 0.07% HTML 0.48% Vue 20.86% TypeScript 75.98% SCSS 1.85% PLpgSQL 0.46% Shell 0.01% CSS 0.30%
postgresql explain

pev2's Introduction

PEV2: A VueJS component to show a graphical vizualization of a PostgreSQL execution plan.

Usage

To use the explain vizualizer you can choose one of the following options:

Dalibo service (recommended)

explain.dalibo.com

This service is provided by Dalibo and can help you to share your plans with colleagues or customers.

All-in-one local (no installation, no network)

PEV2 can be run locally without any external internet resource.

Simply download index.html, open it in your favorite internet browser.

Integrated in a web application

Without building tools

<script src="https://unpkg.com/[email protected]/dist/vue.global.prod.js"></script>
<script src="https://unpkg.com/pev2/dist/pev2.umd.js"></script>
<link
  href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css"
  rel="stylesheet"
/>
<link rel="stylesheet" href="https://unpkg.com/pev2/dist/style.css" />

<div id="app">
  <pev2 :plan-source="plan" plan-query="" />
</div>

<script>
  const { createApp } = Vue

  const plan = "Seq Scan on foo  (cost=0.00..155.00 rows=10000 width=4)"

  const app = createApp({
    data() {
      return {
        plan: plan,
      }
    },
  })
  app.component("pev2", pev2.Plan)
  app.mount("#app")
</script>

See it live.

With build tools

PEV2 can be integrated as a component in a web application.

Install it:

npm install pev2

Declare the PEV2 component and use it:

import { Plan } from "pev2"
import "pev2/dist/style.css"

export default {
  name: "PEV2 example",
  components: {
    pev2: Plan,
  },
  data() {
    return {
      plan: plan,
      query: query,
    }
  },
}

Then add the PEV2 component to your template:

<div id="app">
  <pev2 :plan-source="plan" :plan-query="query"></pev2>
</div>

PEV2 requires Bootstrap (CSS) to work so don't forget to add the following in you header (or load them with your favorite bundler).

<link
  href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css"
  rel="stylesheet"
/>

See it live.

Disclaimer

This project is a rewrite of the excellent Postgres Explain Visualizer (pev). Kudos go to Alex Tatiyants.

The pev project was initialy written in early 2016 but seems to be abandoned since then. There was no activity at all for more than 3 years and counting though there are several issues open and relevant pull requests pending.

pev2's People

Contributors

arp242 avatar bocytko avatar dakulov avatar dependabot[bot] avatar derhuerst avatar dkarneman avatar greenkeeper[bot] avatar jankatins avatar meob avatar pgiraud avatar seymourisdead avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pev2's Issues

Unable to parse plan

The following plan in text format cannot be parsed. Depesz is able to parse, we should be able as wel.

                                                                QUERY PLAN












---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=60040.95..60040.97 rows=1 width=72) (actual time=170339.352..170339.352 rows=1 loops=1)
   Output: current_database(), CASE WHEN ((sum(sq.relpages))::double precision > sum(COALESCE(('1'::double precision + ceil((sq.reltuples / floor((((((((current_setting('block_size'::text))
::numeric) - ((16))::numeric) - ((24))::numeric) * (sq.fillfactor)::numeric))::double precision / ('100'::double precision * (('4'::numeric + ((((((((CASE WHEN (max(COALESCE(s.null_frac, '0
'::real)) = '0'::double precision) THEN 2 ELSE 6 END) + (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) - CASE WHEN ((
(CASE WHEN (max(COALESCE(s.null_frac, '0'::real)) = '0'::double precision) THEN 2 ELSE 6 END) % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::t
ext)) THEN 8 ELSE 4 END)) = 0) THEN (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END) ELSE ((CASE WHEN (max(COALESCE(s.nu
ll_frac, '0'::real)) = '0'::double precision) THEN 2 ELSE 6 END) % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) END
))::double precision + (sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double precision)))) + ((CASE WHEN ((version() ~ 'mingw32'::text) OR
 (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END))::double precision) - (CASE WHEN ((sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.av
g_width, 1024))::double precision))) = '0'::double precision) THEN 0 WHEN ((((sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double precisi
on))))::integer % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) = 0) THEN (CASE WHEN ((version() ~ 'mingw32'::text)
OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END) ELSE (((sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double p
recision))))::integer % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) END)::double precision))::numeric))::double pr
ecision)))))), '0'::double precision))) THEN ((sum(((sq.relpages)::double precision - COALESCE(('1'::double precision + ceil((sq.reltuples / floor((((((((current_setting('block_size'::text)
)::numeric) - ((16))::numeric) - ((24))::numeric) * (sq.fillfactor)::numeric))::double precision / ('100'::double precision * (('4'::numeric + ((((((((CASE WHEN (max(COALESCE(s.null_frac, '
0'::real)) = '0'::double precision) THEN 2 ELSE 6 END) + (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) - CASE WHEN (
((CASE WHEN (max(COALESCE(s.null_frac, '0'::real)) = '0'::double precision) THEN 2 ELSE 6 END) % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::
text)) THEN 8 ELSE 4 END)) = 0) THEN (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END) ELSE ((CASE WHEN (max(COALESCE(s.n
ull_frac, '0'::real)) = '0'::double precision) THEN 2 ELSE 6 END) % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) EN
D))::double precision + (sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double precision)))) + ((CASE WHEN ((version() ~ 'mingw32'::text) O
R (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END))::double precision) - (CASE WHEN ((sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.a
vg_width, 1024))::double precision))) = '0'::double precision) THEN 0 WHEN ((((sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double precis
ion))))::integer % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) = 0) THEN (CASE WHEN ((version() ~ 'mingw32'::text)
 OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END) ELSE (((sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double
precision))))::integer % (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END)) END)::double precision))::numeric))::double p
recision)))))), '0'::double precision))) / (sum(sq.relpages))::double precision) * '100'::double precision) ELSE '0'::double precision END
   Buffers: shared hit=223645
   ->  Hash Join  (cost=60038.91..60040.77 rows=1 width=68) (actual time=170309.805..170326.585 rows=3977 loops=1)
         Output: sq.relpages, sq.reltuples, ((current_setting('block_size'::text))::numeric), (16), (24), sq.fillfactor, (CASE WHEN (max(COALESCE(s.null_frac, '0'::real)) = '0'::double prec
ision) THEN 2 ELSE 6 END), (CASE WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END), (sum((('1'::double precision - COALESCE(s.n
ull_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double precision)))
         Inner Unique: true
         Hash Cond: (sq.relam = am.oid)
         Buffers: shared hit=223645
         ->  GroupAggregate  (cost=60037.83..60039.38 rows=23 width=269) (actual time=170309.711..170325.601 rows=3977 loops=1)
               Output: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, ((current_setting('block_size'::text))::numeric), sq.fillfactor, CASE WHEN ((ver
sion() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8 ELSE 4 END, 24, 16, CASE WHEN (max(COALESCE(s.null_frac, '0'::real)) = '0'::double precision) THEN
2 ELSE 6 END, sum((('1'::double precision - COALESCE(s.null_frac, '0'::real)) * (COALESCE(s.avg_width, 1024))::double precision)), NULL::boolean
               Group Key: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, ((current_setting('block_size'::text))::numeric), sq.fillfactor
               Buffers: shared hit=223644
               ->  Sort  (cost=60037.83..60037.88 rows=23 width=252) (actual time=170309.405..170309.720 rows=4032 loops=1)
                     Output: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, ((current_setting('block_size'::text))::numeric), sq.fillfactor, s.null_fr
ac, s.avg_width
                     Sort Key: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, sq.fillfactor
                     Sort Method: quicksort  Memory: 1168kB
                     Buffers: shared hit=223644
                     ->  Nested Loop  (cost=44832.31..60037.31 rows=23 width=252) (actual time=768.246..170300.695 rows=4032 loops=1)
                           Output: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, (current_setting('block_size'::text))::numeric, sq.fillfactor, s.nul
l_frac, s.avg_width
                           Inner Unique: true
                           Buffers: shared hit=223635
                           ->  Merge Join  (cost=44832.02..60029.40 rows=23 width=224) (actual time=768.200..170266.644 rows=4032 loops=1)
                                 Output: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, sq.fillfactor, sq.atttypid, s.null_frac, s.avg_width
                                 Merge Cond: (s.schemaname = sq.nspname)
                                 Join Filter: (((s.tablename = sq.tblname) AND ((s.attname)::text = pg_get_indexdef(sq.attrelid, (sq.attnum)::integer, true))) OR ((s.tablename = sq.idxname)
 AND (s.attname = sq.attname)))
                                 Rows Removed by Join Filter: 813056483
                                 Buffers: shared hit=215570
                                 ->  Sort  (cost=36484.07..36495.72 rows=4658 width=200) (actual time=422.313..480.242 rows=192836 loops=1)
                                       Output: s.null_frac, s.avg_width, s.schemaname, s.tablename, s.attname
                                       Sort Key: s.schemaname
                                       Sort Method: quicksort  Memory: 56536kB
                                       Buffers: shared hit=99381
                                       ->  Subquery Scan on s  (cost=9803.24..36200.27 rows=4658 width=200) (actual time=215.675..359.935 rows=192836 loops=1)
                                             Output: s.null_frac, s.avg_width, s.schemaname, s.tablename, s.attname
                                             Buffers: shared hit=99381
                                             ->  Gather  (cost=9803.24..36153.69 rows=4658 width=401) (actual time=215.674..352.397 rows=192836 loops=1)
                                                   Output: n.nspname, c.relname, a.attname, NULL::boolean, s_1.stanullfrac, s_1.stawidth, NULL::real, NULL::anyarray, NULL::real[], NULL::any
array, NULL::real, NULL::anyarray, NULL::real[], NULL::real[]
                                                   Workers Planned: 2
                                                   Workers Launched: 2
                                                   Buffers: shared hit=99381
                                                   ->  Hash Left Join  (cost=8803.24..34687.89 rows=1941 width=401) (actual time=207.039..319.017 rows=64279 loops=3)
                                                         Output: n.nspname, c.relname, a.attname, NULL::boolean, s_1.stanullfrac, s_1.stawidth, NULL::real, NULL::anyarray, NULL::real[], NUL
L::anyarray, NULL::real, NULL::anyarray, NULL::real[], NULL::real[]
                                                         Inner Unique: true
                                                         Hash Cond: (c.relnamespace = n.oid)
                                                         Buffers: shared hit=99381
                                                         Worker 0: actual time=204.014..349.926 rows=86155 loops=1
                                                           Buffers: shared hit=36381
                                                         Worker 1: actual time=203.572..349.966 rows=85609 loops=1
                                                           Buffers: shared hit=34989
                                                         ->  Parallel Hash Join  (cost=8802.11..34678.06 rows=1941 width=140) (actual time=207.002..306.173 rows=64279 loops=3)
                                                               Output: s_1.stanullfrac, s_1.stawidth, c.relname, c.relnamespace, a.attname
                                                               Hash Cond: ((s_1.starelid = c.oid) AND (s_1.staattnum = a.attnum))
                                                               Buffers: shared hit=99378
                                                               Worker 0: actual time=203.972..332.202 rows=86155 loops=1
                                                                 Buffers: shared hit=36380
                                                               Worker 1: actual time=203.532..332.299 rows=85609 loops=1
                                                                 Buffers: shared hit=34988
                                                               ->  Parallel Seq Scan on pg_catalog.pg_statistic s_1  (cost=0.00..25122.93 rows=74493 width=14) (actual time=0.005..30.552 row
s=64279 loops=3)
                                                                     Output: s_1.starelid, s_1.staattnum, s_1.stainherit, s_1.stanullfrac, s_1.stawidth, s_1.stadistinct, s_1.stakind1, s_1.s
takind2, s_1.stakind3, s_1.stakind4, s_1.stakind5, s_1.staop1, s_1.staop2, s_1.staop3, s_1.staop4, s_1.staop5, s_1.stanumbers1, s_1.stanumbers2, s_1.stanumbers3, s_1.stanumbers4, s_1.stanum
bers5, s_1.stavalues1, s_1.stavalues2, s_1.stavalues3, s_1.stavalues4, s_1.stavalues5
                                                                     Buffers: shared hit=24378
                                                                     Worker 0: actual time=0.006..39.530 rows=86155 loops=1
                                                                       Buffers: shared hit=10905
                                                                     Worker 1: actual time=0.006..39.385 rows=85609 loops=1
                                                                       Buffers: shared hit=10820
                                                               ->  Parallel Hash  (cost=8198.96..8198.96 rows=40210 width=142) (actual time=206.242..206.242 rows=96419 loops=3)
                                                                     Output: c.relname, c.oid, c.relnamespace, a.attname, a.attrelid, a.attnum
                                                                     Buckets: 524288 (originally 131072)  Batches: 1 (originally 1)  Memory Usage: 56992kB
                                                                     Buffers: shared hit=74875
                                                                     Worker 0: actual time=203.644..203.644 rows=99209 loops=1
                                                                       Buffers: shared hit=25414
                                                                     Worker 1: actual time=203.176..203.176 rows=93257 loops=1
                                                                       Buffers: shared hit=24107
                                                                     ->  Hash Join  (cost=1332.97..8198.96 rows=40210 width=142) (actual time=22.327..134.284 rows=96419 loops=3)
                                                                           Output: c.relname, c.oid, c.relnamespace, a.attname, a.attrelid, a.attnum
                                                                           Inner Unique: true
                                                                           Hash Cond: (a.attrelid = c.oid)
                                                                           Join Filter: has_column_privilege(c.oid, a.attnum, 'select'::text)
                                                                           Buffers: shared hit=74875
                                                                           Worker 0: actual time=22.247..132.342 rows=99209 loops=1
                                                                             Buffers: shared hit=25414
                                                                           Worker 1: actual time=22.376..132.298 rows=93257 loops=1
                                                                             Buffers: shared hit=24107
                                                                           ->  Parallel Seq Scan on pg_catalog.pg_attribute a  (cost=0.00..6549.30 rows=120630 width=70) (actual time=0.017..
39.731 rows=96419 loops=3)
                                                                                 Output: a.attrelid, a.attname, a.atttypid, a.attstattarget, a.attlen, a.attnum, a.attndims, a.attcacheoff, a
.atttypmod, a.attbyval, a.attstorage, a.attalign, a.attnotnull, a.atthasdef, a.atthasmissing, a.attidentity, a.attisdropped, a.attislocal, a.attinhcount, a.attcollation, a.attacl, a.attopti
ons, a.attfdwoptions, a.attmissingval
                                                                                 Filter: (NOT a.attisdropped)
                                                                                 Buffers: shared hit=5343
                                                                                 Worker 0: actual time=0.020..39.584 rows=99209 loops=1
                                                                                   Buffers: shared hit=1834
                                                                                 Worker 1: actual time=0.018..39.469 rows=93257 loops=1
                                                                                   Buffers: shared hit=1721
                                                                           ->  Hash  (cost=1101.49..1101.49 rows=18519 width=72) (actual time=22.042..22.042 rows=17371 loops=3)
                                                                                 Output: c.relname, c.oid, c.relnamespace
                                                                                 Buckets: 32768  Batches: 1  Memory Usage: 2021kB
                                                                                 Buffers: shared hit=2610
                                                                                 Worker 0: actual time=21.980..21.981 rows=17371 loops=1
                                                                                   Buffers: shared hit=870
                                                                                 Worker 1: actual time=22.081..22.081 rows=17371 loops=1
                                                                                   Buffers: shared hit=870
                                                                                 ->  Seq Scan on pg_catalog.pg_class c  (cost=0.00..1101.49 rows=18519 width=72) (actual time=0.007..15.270 r
ows=17371 loops=3)
                                                                                       Output: c.relname, c.oid, c.relnamespace
                                                                                       Filter: ((NOT c.relrowsecurity) OR (NOT row_security_active(c.oid)))
                                                                                       Buffers: shared hit=2610
                                                                                       Worker 0: actual time=0.007..15.521 rows=17371 loops=1
                                                                                         Buffers: shared hit=870
                                                                                       Worker 1: actual time=0.008..14.823 rows=17371 loops=1
                                                                                         Buffers: shared hit=870
                                                         ->  Hash  (cost=1.06..1.06 rows=6 width=68) (actual time=0.025..0.025 rows=6 loops=3)
                                                               Output: n.nspname, n.oid
                                                               Buckets: 1024  Batches: 1  Memory Usage: 9kB
                                                               Buffers: shared hit=3
                                                               Worker 0: actual time=0.030..0.030 rows=6 loops=1
                                                                 Buffers: shared hit=1
                                                               Worker 1: actual time=0.029..0.029 rows=6 loops=1
                                                                 Buffers: shared hit=1
                                                               ->  Seq Scan on pg_catalog.pg_namespace n  (cost=0.00..1.06 rows=6 width=68) (actual time=0.014..0.015 rows=6 loops=3)
                                                                     Output: n.nspname, n.oid
                                                                     Buffers: shared hit=3
                                                                     Worker 0: actual time=0.018..0.019 rows=6 loops=1
                                                                       Buffers: shared hit=1
                                                                     Worker 1: actual time=0.017..0.019 rows=6 loops=1
                                                                       Buffers: shared hit=1
                                 ->  Sort  (cost=8347.95..8398.07 rows=20047 width=282) (actual time=39.290..35051.869 rows=813060136 loops=1)
                                       Output: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, sq.fillfactor, sq.attnum, sq.attname, sq.atttypid
                                       Sort Key: sq.nspname
                                       Sort Method: quicksort  Memory: 2471kB
                                       Buffers: shared hit=31494
                                       ->  Subquery Scan on sq  (cost=6314.07..6915.48 rows=20047 width=282) (actual time=5.633..36.558 rows=4418 loops=1)
                                             Output: sq.nspname, sq.tblname, sq.idxname, sq.reltuples, sq.relpages, sq.relam, sq.attrelid, sq.fillfactor, sq.attnum, sq.attname, sq.atttypid
                                             Buffers: shared hit=31494
                                             ->  CTE Scan on q  (cost=6314.07..6715.01 rows=20047 width=453) (actual time=5.632..35.899 rows=4418 loops=1)
                                                   Output: q.nspname, q.tblname, q.idxname, q.reltuples, q.relpages, q.relam, NULL::oid, NULL::oid, q.fillfactor, q.attrelid, q.attname, q.at
ttypid, NULL::integer, NULL::smallint, q.attnum, NULL::integer, NULL::integer, NULL::integer, NULL::boolean, NULL::"char", NULL::"char", NULL::boolean, NULL::boolean, NULL::boolean, NULL::"
char", NULL::boolean, NULL::boolean, NULL::integer, NULL::oid, NULL::aclitem[], NULL::text[], NULL::text[], NULL::anyarray
                                                   Buffers: shared hit=31494
                                                   CTE q
                                                     ->  Nested Loop  (cost=1160.57..6314.07 rows=20047 width=454) (actual time=5.625..30.341 rows=4418 loops=1)
                                                           Output: pg_namespace.nspname, tbl.relname, idx.relname, idx.reltuples, idx.relpages, idx.relam, pg_index.indrelid, pg_index.indexr
elid, COALESCE((("substring"(array_to_string(idx.reloptions, ' '::text), 'fillfactor=([0-9]+)'::text))::smallint)::integer, 90), a_1.attrelid, a_1.attname, a_1.atttypid, a_1.attstattarget,
a_1.attlen, a_1.attnum, a_1.attndims, a_1.attcacheoff, a_1.atttypmod, a_1.attbyval, a_1.attstorage, a_1.attalign, a_1.attnotnull, a_1.atthasdef, a_1.atthasmissing, a_1.attidentity, a_1.atti
sdropped, a_1.attislocal, a_1.attinhcount, a_1.attcollation, a_1.attacl, a_1.attoptions, a_1.attfdwoptions, a_1.attmissingval
                                                           Buffers: shared hit=31494
                                                           ->  Hash Join  (cost=1160.15..2602.95 rows=1559 width=265) (actual time=5.581..19.496 rows=4341 loops=1)
                                                                 Output: pg_index.indrelid, pg_index.indexrelid, idx.relname, idx.reltuples, idx.relpages, idx.relam, idx.reloptions, idx.oid
, tbl.relname, pg_namespace.nspname
                                                                 Inner Unique: true
                                                                 Hash Cond: (idx.relnamespace = pg_namespace.oid)
                                                                 Buffers: shared hit=14102
                                                                 ->  Nested Loop  (cost=1159.01..2594.83 rows=1559 width=205) (actual time=5.545..18.331 rows=4341 loops=1)
                                                                       Output: pg_index.indrelid, pg_index.indexrelid, idx.relname, idx.reltuples, idx.relpages, idx.relam, idx.reloptions, i
dx.oid, idx.relnamespace, tbl.relname
                                                                       Inner Unique: true
                                                                       Buffers: shared hit=14101
                                                                       ->  Hash Join  (cost=1158.72..1462.46 rows=2169 width=72) (actual time=5.515..9.805 rows=4341 loops=1)
                                                                             Output: pg_index.indrelid, pg_index.indexrelid, tbl.relname
                                                                             Inner Unique: true
                                                                             Hash Cond: (pg_index.indrelid = tbl.oid)
                                                                             Buffers: shared hit=1063
                                                                             ->  Seq Scan on pg_catalog.pg_index  (cost=0.00..280.71 rows=8771 width=8) (actual time=0.005..2.700 rows=8649 l
oops=1)
                                                                                   Output: pg_index.indexrelid, pg_index.indrelid, pg_index.indnatts, pg_index.indnkeyatts, pg_index.indisuni
que, pg_index.indisprimary, pg_index.indisexclusion, pg_index.indimmediate, pg_index.indisclustered, pg_index.indisvalid, pg_index.indcheckxmin, pg_index.indisready, pg_index.indislive, pg_
index.indisreplident, pg_index.indkey, pg_index.indcollation, pg_index.indclass, pg_index.indoption, pg_index.indexprs, pg_index.indpred
                                                                                   Filter: pg_index.indisvalid
                                                                                   Buffers: shared hit=193
                                                                             ->  Hash  (cost=1101.49..1101.49 rows=4579 width=68) (actual time=5.444..5.444 rows=4295 loops=1)
                                                                                   Output: tbl.relname, tbl.oid
                                                                                   Buckets: 8192  Batches: 1  Memory Usage: 484kB
                                                                                   Buffers: shared hit=870
                                                                                   ->  Seq Scan on pg_catalog.pg_class tbl  (cost=0.00..1101.49 rows=4579 width=68) (actual time=0.005..4.574
 rows=4295 loops=1)
                                                                                         Output: tbl.relname, tbl.oid
                                                                                         Filter: (tbl.relkind = 'r'::"char")
                                                                                         Rows Removed by Filter: 13076
                                                                                         Buffers: shared hit=870
                                                                       ->  Index Scan using pg_class_oid_index on pg_catalog.pg_class idx  (cost=0.29..0.52 rows=1 width=133) (actual time=0.
002..0.002 rows=1 loops=4341)
                                                                             Output: idx.relname, idx.reltuples, idx.relpages, idx.relam, idx.reloptions, idx.oid, idx.relnamespace
                                                                             Index Cond: (idx.oid = pg_index.indexrelid)
                                                                             Filter: (idx.relpages > 0)
                                                                             Buffers: shared hit=13038
                                                                 ->  Hash  (cost=1.06..1.06 rows=6 width=68) (actual time=0.024..0.024 rows=6 loops=1)
                                                                       Output: pg_namespace.nspname, pg_namespace.oid
                                                                       Buckets: 1024  Batches: 1  Memory Usage: 9kB
                                                                       Buffers: shared hit=1
                                                                       ->  Seq Scan on pg_catalog.pg_namespace  (cost=0.00..1.06 rows=6 width=68) (actual time=0.018..0.020 rows=6 loops=1)
                                                                             Output: pg_namespace.nspname, pg_namespace.oid
                                                                             Buffers: shared hit=1
                                                           ->  Index Scan using pg_attribute_relid_attnum_index on pg_catalog.pg_attribute a_1  (cost=0.42..1.93 rows=29 width=238) (actual t
ime=0.002..0.002 rows=1 loops=4341)
                                                                 Output: a_1.attrelid, a_1.attname, a_1.atttypid, a_1.attstattarget, a_1.attlen, a_1.attnum, a_1.attndims, a_1.attcacheoff, a
_1.atttypmod, a_1.attbyval, a_1.attstorage, a_1.attalign, a_1.attnotnull, a_1.atthasdef, a_1.atthasmissing, a_1.attidentity, a_1.attisdropped, a_1.attislocal, a_1.attinhcount, a_1.attcollat
ion, a_1.attacl, a_1.attoptions, a_1.attfdwoptions, a_1.attmissingval
                                                                 Index Cond: ((a_1.attrelid = idx.oid) AND (a_1.attnum > 0))
                                                                 Buffers: shared hit=17392
                           ->  Index Only Scan using pg_type_oid_index on pg_catalog.pg_type t  (cost=0.29..0.34 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=4032)
                                 Output: t.oid
                                 Index Cond: (t.oid = sq.atttypid)
                                 Heap Fetches: 0
                                 Buffers: shared hit=8065
         ->  Hash  (cost=1.07..1.07 rows=1 width=4) (actual time=0.018..0.018 rows=1 loops=1)
               Output: am.oid
               Buckets: 1024  Batches: 1  Memory Usage: 9kB
               Buffers: shared hit=1
               ->  Seq Scan on pg_catalog.pg_am am  (cost=0.00..1.07 rows=1 width=4) (actual time=0.009..0.011 rows=1 loops=1)
                     Output: am.oid
                     Filter: (am.amname = 'btree'::name)
                     Rows Removed by Filter: 5
                     Buffers: shared hit=1
 Planning Time: 7.969 ms
 Execution Time: 170366.386 ms
(195 rows)

Support for XML and YAML plans

Plans in XML and YAML formats are not seen often in the wild. But some customer could send a plan in such a format.

If it is easy to support (automatic conversion to JSON ?), it would be nice to have; if not, IMHO it's not worth the effort.

Unformatted JSON plan (e.g. no linebreaks) causes errors

Try this plan:

[ { "Plan": { "Node Type": "Nested Loop", "Parallel Aware": false, "Join Type": "Inner", "Startup Cost": 0.08, "Total Cost": 7764.78, "Plan Rows": 25, "Plan Width": 152, "Actual Startup Time": 547.199, "Actual Total Time": 1313.963, "Actual Rows": 1, "Actual Loops": 1, "Output": ["u.id", "u.first_name", "u.last_name", "u.email", "u.password", "u.is_staff", "u.is_active", "u.is_superuser", "u.last_login", "u.date_joined", "u.is_anonymized", "ug.id", "ug.user_id", "ug.group_id"], "Shared Hit Blocks": 6749, "Shared Read Blocks": 3, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0, "I/O Read Time": 77.588, "I/O Write Time": 0.000, "Plans": [ { "Node Type": "Seq Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Relation Name": "accounts_user", "Schema": "public", "Alias": "u", "Startup Cost": 0.00, "Total Cost": 7658.40, "Plan Rows": 26, "Plan Width": 140, "Actual Startup Time": 469.548, "Actual Total Time": 1236.308, "Actual Rows": 1, "Actual Loops": 1, "Output": ["u.id", "u.first_name", "u.last_name", "u.email", "u.password", "u.is_staff", "u.is_active", "u.is_superuser", "u.last_login", "u.date_joined", "u.is_anonymized"], "Filter": "((u.email)::text ~~ 'karl.blomster%'::text)", "Rows Removed by Filter": 260148, "Shared Hit Blocks": 6748, "Shared Read Blocks": 0, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0, "I/O Read Time": 0.000, "I/O Write Time": 0.000 }, { "Node Type": "Index Scan", "Parent Relationship": "Inner", "Parallel Aware": false, "Scan Direction": "Forward", "Index Name": "auth_user_groups_user_id", "Relation Name": "accounts_user_groups", "Schema": "public", "Alias": "ug", "Startup Cost": 0.08, "Total Cost": 4.09, "Plan Rows": 1, "Plan Width": 12, "Actual Startup Time": 77.642, "Actual Total Time": 77.644, "Actual Rows": 1, "Actual Loops": 1, "Output": ["ug.id", "ug.user_id", "ug.group_id"], "Index Cond": "(ug.user_id = u.id)", "Rows Removed by Index Recheck": 0, "Shared Hit Blocks": 1, "Shared Read Blocks": 3, "Shared Dirtied Blocks": 0, "Shared Written Blocks": 0, "Local Hit Blocks": 0, "Local Read Blocks": 0, "Local Dirtied Blocks": 0, "Local Written Blocks": 0, "Temp Read Blocks": 0, "Temp Written Blocks": 0, "I/O Read Time": 77.588, "I/O Write Time": 0.000 } ] }, "Planning Time": 409.953, "Triggers": [ ], "Execution Time": 1314.048 } ]

Results in a single node with the name "undefined". Formatting the JSON first works - this works fine:

[
  {
    "Plan": {
      "Node Type": "Nested Loop",
      "Parallel Aware": false,
      "Join Type": "Inner",
      "Startup Cost": 0.08,
      "Total Cost": 7764.78,
      "Plan Rows": 25,
      "Plan Width": 152,
      "Actual Startup Time": 547.199,
      "Actual Total Time": 1313.963,
      "Actual Rows": 1,
      "Actual Loops": 1,
      "Output": [
        "u.id",
        "u.first_name",
        "u.last_name",
        "u.email",
        "u.password",
        "u.is_staff",
        "u.is_active",
        "u.is_superuser",
        "u.last_login",
        "u.date_joined",
        "u.is_anonymized",
        "ug.id",
        "ug.user_id",
        "ug.group_id"
      ],
      "Shared Hit Blocks": 6749,
      "Shared Read Blocks": 3,
      "Shared Dirtied Blocks": 0,
      "Shared Written Blocks": 0,
      "Local Hit Blocks": 0,
      "Local Read Blocks": 0,
      "Local Dirtied Blocks": 0,
      "Local Written Blocks": 0,
      "Temp Read Blocks": 0,
      "Temp Written Blocks": 0,
      "I/O Read Time": 77.588,
      "I/O Write Time": 0.000,
      "Plans": [
        {
          "Node Type": "Seq Scan",
          "Parent Relationship": "Outer",
          "Parallel Aware": false,
          "Relation Name": "accounts_user",
          "Schema": "public",
          "Alias": "u",
          "Startup Cost": 0.00,
          "Total Cost": 7658.40,
          "Plan Rows": 26,
          "Plan Width": 140,
          "Actual Startup Time": 469.548,
          "Actual Total Time": 1236.308,
          "Actual Rows": 1,
          "Actual Loops": 1,
          "Output": [
            "u.id",
            "u.first_name",
            "u.last_name",
            "u.email",
            "u.password",
            "u.is_staff",
            "u.is_active",
            "u.is_superuser",
            "u.last_login",
            "u.date_joined",
            "u.is_anonymized"
          ],
          "Filter": "((u.email)::text ~~ 'karl.blomster%'::text)",
          "Rows Removed by Filter": 260148,
          "Shared Hit Blocks": 6748,
          "Shared Read Blocks": 0,
          "Shared Dirtied Blocks": 0,
          "Shared Written Blocks": 0,
          "Local Hit Blocks": 0,
          "Local Read Blocks": 0,
          "Local Dirtied Blocks": 0,
          "Local Written Blocks": 0,
          "Temp Read Blocks": 0,
          "Temp Written Blocks": 0,
          "I/O Read Time": 0.000,
          "I/O Write Time": 0.000
        },
        {
          "Node Type": "Index Scan",
          "Parent Relationship": "Inner",
          "Parallel Aware": false,
          "Scan Direction": "Forward",
          "Index Name": "auth_user_groups_user_id",
          "Relation Name": "accounts_user_groups",
          "Schema": "public",
          "Alias": "ug",
          "Startup Cost": 0.08,
          "Total Cost": 4.09,
          "Plan Rows": 1,
          "Plan Width": 12,
          "Actual Startup Time": 77.642,
          "Actual Total Time": 77.644,
          "Actual Rows": 1,
          "Actual Loops": 1,
          "Output": [
            "ug.id",
            "ug.user_id",
            "ug.group_id"
          ],
          "Index Cond": "(ug.user_id = u.id)",
          "Rows Removed by Index Recheck": 0,
          "Shared Hit Blocks": 1,
          "Shared Read Blocks": 3,
          "Shared Dirtied Blocks": 0,
          "Shared Written Blocks": 0,
          "Local Hit Blocks": 0,
          "Local Read Blocks": 0,
          "Local Dirtied Blocks": 0,
          "Local Written Blocks": 0,
          "Temp Read Blocks": 0,
          "Temp Written Blocks": 0,
          "I/O Read Time": 77.588,
          "I/O Write Time": 0.000
        }
      ]
    },
    "Planning Time": 409.953,
    "Triggers": [],
    "Execution Time": 1314.048
  }
]

Thanks for picking up this project, by the way!

Allow copying text in nodes

Hi, Thanks again for maintaining this project.

I found that there is no way to copy text from any node
I am trying to copy the index name from it so I can find the existing index and add a new one similar to existing one but more specific (eliminate the "filter" part)

I can see that the pev1 allows that
I understand pev2 has a dragging function which is absent in pev1
But would it be possible to disable that with an option and allow copying?

CTE scan may not be correctly detected

And thus may not be displayed correctly.

Hash Join  (cost=17116.79..44169.26 rows=4827 width=25)
   Hash Cond: (artist.area = country.id)
   CTE artist_count
 	->  Limit  (cost=17111.20..17111.20 rows=1 width=12)
       	->  Sort  (cost=17111.20..17111.58 rows=152 width=12)
             	Sort Key: (count(*)) DESC
             	->  Finalize GroupAggregate  (cost=17071.93..17110.44 rows=152 width=12)
                   	Group Key: artist_1.area
                   	->  Gather Merge  (cost=17071.93..17107.40 rows=304 width=12)
                         	Workers Planned: 2
                         	->  Sort  (cost=16071.91..16072.29 rows=152 width=12)
                               	Sort Key: artist_1.area
                               	->  Partial HashAggregate  (cost=16064.88..16066.40 rows=152 width=12)
                                     	Group Key: artist_1.area
                                     	->  Parallel Seq Scan on artist artist_1  (cost=0.00..15146.88 rows=183599 width=4)
                                           	Filter: (area IS NOT NULL)
   ->  Seq Scan on artist  (cost=0.00..22383.32 rows=1240532 width=18)
   ->  Hash  (cost=5.58..5.58 rows=1 width=19)
     	->  Hash Join  (cost=0.03..5.58 rows=1 width=19)
           	Hash Cond: (country.id = artist_count.area)
           	->  Seq Scan on country  (cost=0.00..4.57 rows=257 width=15)
           	->  Hash  (cost=0.02..0.02 rows=1 width=4)
                 	->  CTE Scan on artist_count  (cost=0.00..0.02 rows=1 width=4)

TIMING OFF support

As reported in #75:

TIMING OFF gives an empty result on dalibo.github.io/pev2/.
On explain.dalibo.com , there is a plan but with the label "never executed" (which is false).

explain (analyze, timing off) select * from pg_class ;
                                      QUERY PLAN                                       
---------------------------------------------------------------------------------------
 Seq Scan on pg_class  (cost=0.00..32.98 rows=698 width=776) (actual rows=698 loops=1)
 Planning Time: 0.051 ms
 Execution Time: 0.105 ms
(3 lignes)

The new SETTINGS option (v12) does not lead to a problem,

Couldn't parse plan

Hello,
On https://explain.dalibo.com/, I tried the following plan / SQL:

Bitmap Heap Scan on a
   Recheck Cond: ((id = 42) OR (id = 4711))
   ->  BitmapOr
         ->  Bitmap Index Scan on a_pkey
               Index Cond: (id = 42)
         ->  Bitmap Index Scan on a_pkey
               Index Cond: (id = 4711)

SELECT id FROM a
WHERE id = 42
   OR id = 4711

I got the error "Couldn't parse plan"

Reverse query & plan

The interface asks for 1) the plan and 2) the query below.

This is the reverse from the natural order when pasting an EXPLAIN ANALYZE from psql, and I often reverse plan and query.

Suggestion : Reverse the order two fields.

Alternative: automatically recognize the mistake, swap the content of the two fields.

Better alternative: one single field, a single cut-and-paste from psql (EXPLAIN query & plan) and the interface would separate query and plan alone.

Wrong node name for "Hash join"

Hello,

Considering this query:

DROP TABLE IF EXISTS bebe, ahah;

CREATE TABLE ahah (c1 serial PRIMARY KEY, c2 integer);
INSERT INTO ahah (c2) SELECT generate_series(2000, 3000);

CREATE TABLE bebe (c1 serial PRIMARY KEY, c2 integer);
INSERT INTO bebe (c2) SELECT generate_series(2000, 3000);
ANALYZE;

EXPLAIN (ANALYZE, BUFFERS, COSTS OFF)
SELECT ahah.c1, max(ahah.c2), max(bebe.c2)
FROM bebe
JOIN ahah
ON bebe.c1 = ahah.c1
GROUP BY ahah.c1;

Here is the plan:

 HashAggregate (actual time=6.004..7.028 rows=1001 loops=1)
   Group Key: ahah.c1
   Buffers: shared hit=10
   ->  Hash Join (actual time=1.626..4.086 rows=1001 loops=1)
         Hash Cond: (bebe.c1 = ahah.c1)
         Buffers: shared hit=10
         ->  Seq Scan on bebe (actual time=0.039..0.502 rows=1001 loops=1)
               Buffers: shared hit=5
         ->  Hash (actual time=1.558..1.559 rows=1001 loops=1)
               Buckets: 1024  Batches: 1  Memory Usage: 48kB
               Buffers: shared hit=5
               ->  Seq Scan on ahah (actual time=0.029..0.508 rows=1001 loops=1)
                     Buffers: shared hit=5
 Planning Time: 1.497 ms
 Execution Time: 7.490 ms

Pev2 shows "Hash" instead of "Hash Join".

mutiple parallel nodes

Hi!

During testing I've found that some plans produce thousands of "parallel" nodes. Below is an example:

[
  {
    "Plan": {
      "Node Type": "Nested Loop",
      "Parallel Aware": false,
      "Join Type": "Left",
      "Startup Cost": 1005.16,
      "Total Cost": 79258.07,
      "Plan Rows": 3110,
      "Plan Width": 145,
      "Actual Startup Time": 0.976,
      "Actual Total Time": 2332.500,
      "Actual Rows": 194651,
      "Actual Loops": 1,
      "Output": ["(count(*))", "'CREDIPAR'::text", "'100'::text", "d.devcod", "d.devnom", "d.devcpf", "c.connumcon", "sp.sitpadnom", "(CURRENT_DATE - x_1.conpardatven)", "x_2.retdataca"],
      "Inner Unique": false,
      "Shared Hit Blocks": 3833881,
      "Shared Read Blocks": 0,
      "Shared Dirtied Blocks": 0,
      "Shared Written Blocks": 0,
      "Local Hit Blocks": 0,
      "Local Read Blocks": 0,
      "Local Dirtied Blocks": 0,
      "Local Written Blocks": 0,
      "Temp Read Blocks": 0,
      "Temp Written Blocks": 0,
      "Plans": [
        {
          "Node Type": "Nested Loop",
          "Parent Relationship": "Outer",
          "Parallel Aware": false,
          "Join Type": "Left",
          "Startup Cost": 1004.59,
          "Total Cost": 73177.88,
          "Plan Rows": 3110,
          "Plan Width": 81,
          "Actual Startup Time": 0.947,
          "Actual Total Time": 1401.639,
          "Actual Rows": 194651,
          "Actual Loops": 1,
          "Output": ["d.devcod", "d.devnom", "d.devcpf", "d.carcod", "c.connumcon", "(count(*))", "x_1.conpardatven", "sp.sitpadnom"],
          "Inner Unique": false,
          "Shared Hit Blocks": 2859866,
          "Shared Read Blocks": 0,
          "Shared Dirtied Blocks": 0,
          "Shared Written Blocks": 0,
          "Local Hit Blocks": 0,
          "Local Read Blocks": 0,
          "Local Dirtied Blocks": 0,
          "Local Written Blocks": 0,
          "Temp Read Blocks": 0,
          "Temp Written Blocks": 0,
          "Plans": [
            {
              "Node Type": "Nested Loop",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Join Type": "Left",
              "Startup Cost": 1004.03,
              "Total Cost": 55137.97,
              "Plan Rows": 3110,
              "Plan Width": 85,
              "Actual Startup Time": 0.924,
              "Actual Total Time": 784.674,
              "Actual Rows": 194651,
              "Actual Loops": 1,
              "Output": ["d.devcod", "d.devnom", "d.devcpf", "d.carcod", "c.connumcon", "c.concod", "(count(*))", "sp.sitpadnom"],
              "Inner Unique": false,
              "Shared Hit Blocks": 1885824,
              "Shared Read Blocks": 0,
              "Shared Dirtied Blocks": 0,
              "Shared Written Blocks": 0,
              "Local Hit Blocks": 0,
              "Local Read Blocks": 0,
              "Local Dirtied Blocks": 0,
              "Local Written Blocks": 0,
              "Temp Read Blocks": 0,
              "Temp Written Blocks": 0,
              "Plans": [
                {
                  "Node Type": "Gather",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Startup Cost": 1002.35,
                  "Total Cost": 49804.32,
                  "Plan Rows": 3110,
                  "Plan Width": 89,
                  "Actual Startup Time": 0.897,
                  "Actual Total Time": 53.637,
                  "Actual Rows": 194651,
                  "Actual Loops": 1,
                  "Output": ["d.devcod", "d.devnom", "d.devcpf", "d.carcod", "c.connumcon", "c.carcod", "c.devcod", "c.concod", "sp.sitpadnom"],
                  "Workers Planned": 3,
                  "Workers Launched": 3,
                  "Single Copy": false,
                  "Shared Hit Blocks": 955451,
                  "Shared Read Blocks": 0,
                  "Shared Dirtied Blocks": 0,
                  "Shared Written Blocks": 0,
                  "Local Hit Blocks": 0,
                  "Local Read Blocks": 0,
                  "Local Dirtied Blocks": 0,
                  "Local Written Blocks": 0,
                  "Temp Read Blocks": 0,
                  "Temp Written Blocks": 0,
                  "Plans": [
                    {
                      "Node Type": "Hash Join",
                      "Parent Relationship": "Outer",
                      "Parallel Aware": false,
                      "Join Type": "Left",
                      "Startup Cost": 2.35,
                      "Total Cost": 48493.32,
                      "Plan Rows": 1003,
                      "Plan Width": 89,
                      "Actual Startup Time": 0.254,
                      "Actual Total Time": 196.019,
                      "Actual Rows": 48663,
                      "Actual Loops": 4,
                      "Output": ["d.devcod", "d.devnom", "d.devcpf", "d.carcod", "c.connumcon", "c.carcod", "c.devcod", "c.concod", "sp.sitpadnom"],
                      "Inner Unique": true,
                      "Hash Cond": "(d.devsitcod = sp.sitpadcod)",
                      "Shared Hit Blocks": 955451,
                      "Shared Read Blocks": 0,
                      "Shared Dirtied Blocks": 0,
                      "Shared Written Blocks": 0,
                      "Local Hit Blocks": 0,
                      "Local Read Blocks": 0,
                      "Local Dirtied Blocks": 0,
                      "Local Written Blocks": 0,
                      "Temp Read Blocks": 0,
                      "Temp Written Blocks": 0,
                      "Workers": [
                        {
                          "Worker Number": 0,
                          "Actual Startup Time": 0.315,
                          "Actual Total Time": 5.059,
                          "Actual Rows": 609,
                          "Actual Loops": 1,
                          "Shared Hit Blocks": 2901,
                          "Shared Read Blocks": 0,
                          "Shared Dirtied Blocks": 0,
                          "Shared Written Blocks": 0,
                          "Local Hit Blocks": 0,
                          "Local Read Blocks": 0,
                          "Local Dirtied Blocks": 0,
                          "Local Written Blocks": 0,
                          "Temp Read Blocks": 0,
                          "Temp Written Blocks": 0
                        },
                        {
                          "Worker Number": 1,
                          "Actual Startup Time": 0.301,
                          "Actual Total Time": 4.766,
                          "Actual Rows": 609,
                          "Actual Loops": 1,
                          "Shared Hit Blocks": 2868,
                          "Shared Read Blocks": 0,
                          "Shared Dirtied Blocks": 0,
                          "Shared Written Blocks": 0,
                          "Local Hit Blocks": 0,
                          "Local Read Blocks": 0,
                          "Local Dirtied Blocks": 0,
                          "Local Written Blocks": 0,
                          "Temp Read Blocks": 0,
                          "Temp Written Blocks": 0
                        },
                        {
                          "Worker Number": 2,
                          "Actual Startup Time": 0.320,
                          "Actual Total Time": 771.618,
                          "Actual Rows": 192820,
                          "Actual Loops": 1,
                          "Shared Hit Blocks": 946820,
                          "Shared Read Blocks": 0,
                          "Shared Dirtied Blocks": 0,
                          "Shared Written Blocks": 0,
                          "Local Hit Blocks": 0,
                          "Local Read Blocks": 0,
                          "Local Dirtied Blocks": 0,
                          "Local Written Blocks": 0,
                          "Temp Read Blocks": 0,
                          "Temp Written Blocks": 0
                        }
                      ],
                      "Plans": [
                        {
                          "Node Type": "Nested Loop",
                          "Parent Relationship": "Outer",
                          "Parallel Aware": false,
                          "Join Type": "Inner",
                          "Startup Cost": 0.99,
                          "Total Cost": 48489.19,
                          "Plan Rows": 1003,
                          "Plan Width": 77,
                          "Actual Startup Time": 0.102,
                          "Actual Total Time": 186.353,
                          "Actual Rows": 48663,
                          "Actual Loops": 4,
                          "Output": ["d.devcod", "d.devnom", "d.devcpf", "d.carcod", "d.devsitcod", "c.connumcon", "c.carcod", "c.devcod", "c.concod"],
                          "Inner Unique": true,
                          "Shared Hit Blocks": 955315,
                          "Shared Read Blocks": 0,
                          "Shared Dirtied Blocks": 0,
                          "Shared Written Blocks": 0,
                          "Local Hit Blocks": 0,
                          "Local Read Blocks": 0,
                          "Local Dirtied Blocks": 0,
                          "Local Written Blocks": 0,
                          "Temp Read Blocks": 0,
                          "Temp Written Blocks": 0,
                          "Workers": [
                            {
                              "Worker Number": 0,
                              "Actual Startup Time": 0.123,
                              "Actual Total Time": 4.756,
                              "Actual Rows": 609,
                              "Actual Loops": 1,
                              "Shared Hit Blocks": 2856,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0
                            },
                            {
                              "Worker Number": 1,
                              "Actual Startup Time": 0.118,
                              "Actual Total Time": 4.463,
                              "Actual Rows": 609,
                              "Actual Loops": 1,
                              "Shared Hit Blocks": 2823,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0
                            },
                            {
                              "Worker Number": 2,
                              "Actual Startup Time": 0.120,
                              "Actual Total Time": 733.757,
                              "Actual Rows": 192820,
                              "Actual Loops": 1,
                              "Shared Hit Blocks": 946775,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0
                            }
                          ],
                          "Plans": [
                            {
                              "Node Type": "Index Scan",
                              "Parent Relationship": "Outer",
                              "Parallel Aware": true,
                              "Scan Direction": "Forward",
                              "Index Name": "contrato_iu0010",
                              "Relation Name": "contrato",
                              "Schema": "public",
                              "Alias": "c",
                              "Startup Cost": 0.56,
                              "Total Cost": 28412.33,
                              "Plan Rows": 10505,
                              "Plan Width": 31,
                              "Actual Startup Time": 0.039,
                              "Actual Total Time": 52.080,
                              "Actual Rows": 48663,
                              "Actual Loops": 4,
                              "Output": ["c.concod", "c.carcod", "c.devcod", "c.connumcon", "c.procod", "c.filcod", "c.condatcad", "c.condatpredev", "c.connumpar", "c.condadadi", "c.condatinc", "c.conusuinc", "c.condatatu", "c.conusuatu", "c.conborent", "c.connumcar", "c.conati", "c.convalcon", "c.convalconatu", "c.convenmaisantigo", "c.condiamaisantigo", "c.convalsal", "c.convlrent", "c.condatquenov", "c.conid", "c.connovperacr"],
                              "Index Cond": "((c.carcod = 121) AND (c.conati = 0) AND (c.convalsal > '0'::numeric))",
                              "Rows Removed by Index Recheck": 0,
                              "Shared Hit Blocks": 176016,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0,
                              "Workers": [
                                {
                                  "Worker Number": 0,
                                  "Actual Startup Time": 0.044,
                                  "Actual Total Time": 1.566,
                                  "Actual Rows": 609,
                                  "Actual Loops": 1,
                                  "Shared Hit Blocks": 417,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                },
                                {
                                  "Worker Number": 1,
                                  "Actual Startup Time": 0.042,
                                  "Actual Total Time": 1.520,
                                  "Actual Rows": 609,
                                  "Actual Loops": 1,
                                  "Shared Hit Blocks": 384,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                },
                                {
                                  "Worker Number": 2,
                                  "Actual Startup Time": 0.045,
                                  "Actual Total Time": 204.697,
                                  "Actual Rows": 192820,
                                  "Actual Loops": 1,
                                  "Shared Hit Blocks": 174807,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                }
                              ]
                            },
                            {
                              "Node Type": "Index Scan",
                              "Parent Relationship": "Inner",
                              "Parallel Aware": false,
                              "Scan Direction": "Forward",
                              "Index Name": "devedor_iu0021",
                              "Relation Name": "devedor",
                              "Schema": "public",
                              "Alias": "d",
                              "Startup Cost": 0.43,
                              "Total Cost": 1.91,
                              "Plan Rows": 1,
                              "Plan Width": 46,
                              "Actual Startup Time": 0.002,
                              "Actual Total Time": 0.002,
                              "Actual Rows": 1,
                              "Actual Loops": 194651,
                              "Output": ["d.carcod", "d.devcod", "d.devcpf", "d.devdatnas", "d.devborent", "d.devdatinc", "d.devusuinc", "d.devdatatu", "d.devusuatu", "d.devnom", "d.devid", "d.devultaca", "d.devsal", "d.devsalatu", "d.devvenmaisantigo", "d.devdiamaisantigo", "d.devati", "d.devsitcomcom", "d.devsitcomcod", "d.devdatstatus", "d.devstatus", "d.devultimaremessalinha", "d.devdatultremessa", "d.devultimaremessa", "d.devvenacomaisantigo", "d.devdatadev", "d.devacordo", "d.devretdataca", "d.devretdatage", "d.devretusucod", "d.devusucod", "d.devsitcod", "d.devcadmaisrecente", "d.devcadmaisantigo", "d.devdiamaisrecente", "d.devvenmaisrecente", "d.devretseq", "d.devfase", "d.devvalpar", "d.devdatcal", "d.devdatat", "d.devqtdinc", "d.devdatpridev", "d.devriscod", "d.devultacepor", "d.devultpro", "d.devcodcam"],
                              "Index Cond": "((d.devcod = c.devcod) AND (d.carcod = 121))",
                              "Rows Removed by Index Recheck": 0,
                              "Shared Hit Blocks": 779299,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0,
                              "Workers": [
                                {
                                  "Worker Number": 0,
                                  "Actual Startup Time": 0.004,
                                  "Actual Total Time": 0.004,
                                  "Actual Rows": 1,
                                  "Actual Loops": 609,
                                  "Shared Hit Blocks": 2439,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                },
                                {
                                  "Worker Number": 1,
                                  "Actual Startup Time": 0.004,
                                  "Actual Total Time": 0.004,
                                  "Actual Rows": 1,
                                  "Actual Loops": 609,
                                  "Shared Hit Blocks": 2439,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                },
                                {
                                  "Worker Number": 2,
                                  "Actual Startup Time": 0.002,
                                  "Actual Total Time": 0.002,
                                  "Actual Rows": 1,
                                  "Actual Loops": 192820,
                                  "Shared Hit Blocks": 771968,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "Node Type": "Hash",
                          "Parent Relationship": "Inner",
                          "Parallel Aware": false,
                          "Startup Cost": 1.16,
                          "Total Cost": 1.16,
                          "Plan Rows": 16,
                          "Plan Width": 16,
                          "Actual Startup Time": 0.028,
                          "Actual Total Time": 0.028,
                          "Actual Rows": 16,
                          "Actual Loops": 4,
                          "Output": ["sp.sitpadnom", "sp.sitpadcod"],
                          "Hash Buckets": 1024,
                          "Original Hash Buckets": 1024,
                          "Hash Batches": 1,
                          "Original Hash Batches": 1,
                          "Peak Memory Usage": 9,
                          "Shared Hit Blocks": 4,
                          "Shared Read Blocks": 0,
                          "Shared Dirtied Blocks": 0,
                          "Shared Written Blocks": 0,
                          "Local Hit Blocks": 0,
                          "Local Read Blocks": 0,
                          "Local Dirtied Blocks": 0,
                          "Local Written Blocks": 0,
                          "Temp Read Blocks": 0,
                          "Temp Written Blocks": 0,
                          "Workers": [
                            {
                              "Worker Number": 0,
                              "Actual Startup Time": 0.030,
                              "Actual Total Time": 0.030,
                              "Actual Rows": 16,
                              "Actual Loops": 1,
                              "Shared Hit Blocks": 1,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0
                            },
                            {
                              "Worker Number": 1,
                              "Actual Startup Time": 0.030,
                              "Actual Total Time": 0.030,
                              "Actual Rows": 16,
                              "Actual Loops": 1,
                              "Shared Hit Blocks": 1,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0
                            },
                            {
                              "Worker Number": 2,
                              "Actual Startup Time": 0.032,
                              "Actual Total Time": 0.032,
                              "Actual Rows": 16,
                              "Actual Loops": 1,
                              "Shared Hit Blocks": 1,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0
                            }
                          ],
                          "Plans": [
                            {
                              "Node Type": "Seq Scan",
                              "Parent Relationship": "Outer",
                              "Parallel Aware": false,
                              "Relation Name": "situacao_padrao",
                              "Schema": "public",
                              "Alias": "sp",
                              "Startup Cost": 0.00,
                              "Total Cost": 1.16,
                              "Plan Rows": 16,
                              "Plan Width": 16,
                              "Actual Startup Time": 0.017,
                              "Actual Total Time": 0.020,
                              "Actual Rows": 16,
                              "Actual Loops": 4,
                              "Output": ["sp.sitpadnom", "sp.sitpadcod"],
                              "Shared Hit Blocks": 4,
                              "Shared Read Blocks": 0,
                              "Shared Dirtied Blocks": 0,
                              "Shared Written Blocks": 0,
                              "Local Hit Blocks": 0,
                              "Local Read Blocks": 0,
                              "Local Dirtied Blocks": 0,
                              "Local Written Blocks": 0,
                              "Temp Read Blocks": 0,
                              "Temp Written Blocks": 0,
                              "Workers": [
                                {
                                  "Worker Number": 0,
                                  "Actual Startup Time": 0.020,
                                  "Actual Total Time": 0.023,
                                  "Actual Rows": 16,
                                  "Actual Loops": 1,
                                  "Shared Hit Blocks": 1,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                },
                                {
                                  "Worker Number": 1,
                                  "Actual Startup Time": 0.018,
                                  "Actual Total Time": 0.020,
                                  "Actual Rows": 16,
                                  "Actual Loops": 1,
                                  "Shared Hit Blocks": 1,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                },
                                {
                                  "Worker Number": 2,
                                  "Actual Startup Time": 0.021,
                                  "Actual Total Time": 0.024,
                                  "Actual Rows": 16,
                                  "Actual Loops": 1,
                                  "Shared Hit Blocks": 1,
                                  "Shared Read Blocks": 0,
                                  "Shared Dirtied Blocks": 0,
                                  "Shared Written Blocks": 0,
                                  "Local Hit Blocks": 0,
                                  "Local Read Blocks": 0,
                                  "Local Dirtied Blocks": 0,
                                  "Local Written Blocks": 0,
                                  "Temp Read Blocks": 0,
                                  "Temp Written Blocks": 0
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "Node Type": "Aggregate",
                  "Strategy": "Plain",
                  "Partial Mode": "Simple",
                  "Parent Relationship": "Inner",
                  "Parallel Aware": false,
                  "Startup Cost": 1.69,
                  "Total Cost": 1.70,
                  "Plan Rows": 1,
                  "Plan Width": 8,
                  "Actual Startup Time": 0.003,
                  "Actual Total Time": 0.003,
                  "Actual Rows": 1,
                  "Actual Loops": 194651,
                  "Output": ["count(*)"],
                  "Shared Hit Blocks": 930373,
                  "Shared Read Blocks": 0,
                  "Shared Dirtied Blocks": 0,
                  "Shared Written Blocks": 0,
                  "Local Hit Blocks": 0,
                  "Local Read Blocks": 0,
                  "Local Dirtied Blocks": 0,
                  "Local Written Blocks": 0,
                  "Temp Read Blocks": 0,
                  "Temp Written Blocks": 0,
                  "Plans": [
                    {
                      "Node Type": "Index Only Scan",
                      "Parent Relationship": "Outer",
                      "Parallel Aware": false,
                      "Scan Direction": "Forward",
                      "Index Name": "contrato_iu0010",
                      "Relation Name": "contrato",
                      "Schema": "public",
                      "Alias": "x",
                      "Startup Cost": 0.56,
                      "Total Cost": 1.68,
                      "Plan Rows": 1,
                      "Plan Width": 0,
                      "Actual Startup Time": 0.002,
                      "Actual Total Time": 0.003,
                      "Actual Rows": 4,
                      "Actual Loops": 194651,
                      "Output": ["x.carcod", "x.conati", "x.devcod", "x.convalsal"],
                      "Index Cond": "((x.carcod = c.carcod) AND (x.conati = 0) AND (x.devcod = c.devcod) AND (x.convalsal > '0'::numeric))",
                      "Rows Removed by Index Recheck": 0,
                      "Heap Fetches": 131906,
                      "Shared Hit Blocks": 930373,
                      "Shared Read Blocks": 0,
                      "Shared Dirtied Blocks": 0,
                      "Shared Written Blocks": 0,
                      "Local Hit Blocks": 0,
                      "Local Read Blocks": 0,
                      "Local Dirtied Blocks": 0,
                      "Local Written Blocks": 0,
                      "Temp Read Blocks": 0,
                      "Temp Written Blocks": 0
                    }
                  ]
                }
              ]
            },
            {
              "Node Type": "Limit",
              "Parent Relationship": "Inner",
              "Parallel Aware": false,
              "Startup Cost": 0.56,
              "Total Cost": 5.78,
              "Plan Rows": 1,
              "Plan Width": 4,
              "Actual Startup Time": 0.003,
              "Actual Total Time": 0.003,
              "Actual Rows": 1,
              "Actual Loops": 194651,
              "Output": ["x_1.conpardatven"],
              "Shared Hit Blocks": 974042,
              "Shared Read Blocks": 0,
              "Shared Dirtied Blocks": 0,
              "Shared Written Blocks": 0,
              "Local Hit Blocks": 0,
              "Local Read Blocks": 0,
              "Local Dirtied Blocks": 0,
              "Local Written Blocks": 0,
              "Temp Read Blocks": 0,
              "Temp Written Blocks": 0,
              "Plans": [
                {
                  "Node Type": "Index Scan",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Scan Direction": "Forward",
                  "Index Name": "contrato_parcela_iu0007",
                  "Relation Name": "contrato_parcela",
                  "Schema": "public",
                  "Alias": "x_1",
                  "Startup Cost": 0.56,
                  "Total Cost": 16.22,
                  "Plan Rows": 3,
                  "Plan Width": 4,
                  "Actual Startup Time": 0.003,
                  "Actual Total Time": 0.003,
                  "Actual Rows": 1,
                  "Actual Loops": 194651,
                  "Output": ["x_1.conpardatven"],
                  "Index Cond": "((x_1.concod = c.concod) AND (x_1.conparati = 0))",
                  "Rows Removed by Index Recheck": 0,
                  "Filter": "(x_1.conparvalsal > '0'::numeric)",
                  "Rows Removed by Filter": 0,
                  "Shared Hit Blocks": 974042,
                  "Shared Read Blocks": 0,
                  "Shared Dirtied Blocks": 0,
                  "Shared Written Blocks": 0,
                  "Local Hit Blocks": 0,
                  "Local Read Blocks": 0,
                  "Local Dirtied Blocks": 0,
                  "Local Written Blocks": 0,
                  "Temp Read Blocks": 0,
                  "Temp Written Blocks": 0
                }
              ]
            }
          ]
        },
        {
          "Node Type": "Limit",
          "Parent Relationship": "Inner",
          "Parallel Aware": false,
          "Startup Cost": 0.57,
          "Total Cost": 1.93,
          "Plan Rows": 1,
          "Plan Width": 12,
          "Actual Startup Time": 0.004,
          "Actual Total Time": 0.004,
          "Actual Rows": 1,
          "Actual Loops": 194651,
          "Output": ["x_2.retdataca", "x_2.retseq"],
          "Shared Hit Blocks": 974015,
          "Shared Read Blocks": 0,
          "Shared Dirtied Blocks": 0,
          "Shared Written Blocks": 0,
          "Local Hit Blocks": 0,
          "Local Read Blocks": 0,
          "Local Dirtied Blocks": 0,
          "Local Written Blocks": 0,
          "Temp Read Blocks": 0,
          "Temp Written Blocks": 0,
          "Plans": [
            {
              "Node Type": "Index Scan",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Scan Direction": "Backward",
              "Index Name": "retorno_iu0011",
              "Relation Name": "retorno",
              "Schema": "public",
              "Alias": "x_2",
              "Startup Cost": 0.57,
              "Total Cost": 16.89,
              "Plan Rows": 12,
              "Plan Width": 12,
              "Actual Startup Time": 0.004,
              "Actual Total Time": 0.004,
              "Actual Rows": 1,
              "Actual Loops": 194651,
              "Output": ["x_2.retdataca", "x_2.retseq"],
              "Index Cond": "((d.carcod = x_2.carcod) AND (d.devcod = x_2.devcod))",
              "Rows Removed by Index Recheck": 0,
              "Filter": "(x_2.usucod <> ALL ('{7,43,10,15,9,21,158,777,64,37,74,1008,3028,39,6300,1111,5,950,960,1986,1930,188,285,958,555,222,2018,2019,1987,9090,1996,1997,1992,39,1111,1117,780,1100,2000,51,17}'::integer[]))",
              "Rows Removed by Filter": 0,
              "Shared Hit Blocks": 974015,
              "Shared Read Blocks": 0,
              "Shared Dirtied Blocks": 0,
              "Shared Written Blocks": 0,
              "Local Hit Blocks": 0,
              "Local Read Blocks": 0,
              "Local Dirtied Blocks": 0,
              "Local Written Blocks": 0,
              "Temp Read Blocks": 0,
              "Temp Written Blocks": 0
            }
          ]
        }
      ]
    },
    "Planning Time": 2.229,
    "Triggers": [
    ],
    "Execution Time": 2345.225
  }
]

Never executed - false positive

Reported in #39

Also, on the same plan, I see problems detecting the node type and if it's been executed or not:
image

Edit: Node types are correct, only problem is with "never executed" part.

Handle buffers option output

Hello,

Thanks for this tool. Is it possible to handle the Buffers output (obtained by EXPLAIN (ANALYZE, BUFFERS)) and add the possibility this as graph metric. It's a cumulative metric and is quite useful to identify costly operations.
An example output is:
Buffers: shared hit=199998 read=2988

Thanks

Kind regards

`*Actual Duration` calculation issue causing most nodes shown as "Never executed"

I have a query and most of them are shown as "Never executed" and it seems incorrect

It seems due to issue in *Actual Duration calculation:
image

Yup same screenshot as #22
image

SQL Plan

[
  {
    "Plan": {
      "Node Type": "Limit",
      "Parallel Aware": false,
      "Startup Cost": 21.54,
      "Total Cost": 25.72,
      "Plan Rows": 20,
      "Plan Width": 813,
      "Actual Startup Time": 3.170,
      "Actual Total Time": 3.779,
      "Actual Rows": 20,
      "Actual Loops": 1,
      "Output": ["listings.id", "listings.block", "listings.flat", "listings.gross_area", "listings.net_area", "listings.price", "listings.description", "listings.about", "listings.bedrooms_count", "listings.bathrooms_count", "listings.contact_name", "listings.contact_phone", "listings.contact_email", "listings.source_url", "listings.is_rental", "listings.is_listed_by_agent", "listings.building_id", "listings.created_at", "listings.updated_at", "listings.agency_id", "listings.max_sale_price", "listings.min_sale_price", "listings.avg_sale_price", "listings.max_rental_price", "listings.min_rental_price", "listings.avg_rental_price", "listings.max_annual_percentage_yield", "listings.min_annual_percentage_yield", "listings.avg_annual_percentage_yield", "listings.last_calculate_estimate_at", "listings.floor", "listings.avg_price_to_estimate_diff_percentage", "listings.has_feature_car_park", "listings.has_feature_balcony", "listings.has_feature_sea_view", "listings.has_feature_roof", "listings.has_feature_club_house", "listings.has_feature_gym", "listings.has_feature_pool", "listings.has_feature_tennis", "listings.scraping_source_name", "listings.expired_at", "listings.remote_reference_id", "listings.updated_from_remote_source_at", "listings.property_images_count", "listings.click_contact_count", "listings.agent_license_number", "listings.send_contact_email_count", "listings.searching_expired_at", "listings.user_id", "listings.posted_at", "listings.serviced_apartment_provider_building_relationship_id", "listings.has_view_open", "listings.has_view_mountain", "listings.has_view_city", "listings.has_view_racecourse", "listings.has_view_sea", "listings.has_view_garden", "listings.has_view_building", "listings.has_feature_lift", "listings.has_feature_terrace", "listings.has_feature_maids_quarters", "listings.has_feature_garden", "listings.has_feature_pet_friendly", "listings.near_mtr", "listings.has_feature_duplex", "listings.short_rental", "listings.last_renovated", "listings.parking_count", "listings.furnished", "listings.property_agency_team_id", "listings.is_hdb", "listings.property_type", "listings.avg_rental_price_30_days_ago", "listings.avg_sale_price_30_days_ago", "listings.flat_share_allowed", "listings.confirmed_by_poster_at", "listings.source_white_label_real_estate_agency_id", "listings.quality_score", "listings.land_holding_area_size", "listings.marked_as_featured_at", "listings.average_price_per_area_size_unit", "listings.property_type_identifier", "listings.current_price_to_latest_estimated_price_diff_in_percentage", "listings.estimated_percentage_yield", "listings.is_type_commercial_shop", "listings.is_type_commercial_office", "listings.is_type_commercial_industrial", "listings.extra_attributes_json", "listings.price_max_to_min_diff_percentage", "listings.own_in_company_structure", "listings.occupy_by_tenant", "listings.spacious_business_center_entry_id", "listings.neighbourhood_id", "listings.count_of_tracking_event_with_view_page_type", "listings.self_updated_at", "listings.count_of_enquiries_for_trending_listing_notification", "listings.self_updated_at_after_posted_at_in_seconds", "listings.bedroom_count_updated_at", "listings.net_area_size_updated_at", "listings.price_significantly_updated_at", "listings.original_listing_id", "listings.duplication_state_updated_at", "listings.logical_posted_at", "listings.attrs_4_listing_related_digests_updated_at", "listings.city_id", "listings.building_type_identifier", "listings.paused_at", "listings.video_id", "listings.property_images_updated_at", "listings.poster_input_updated_at", "listings.building_built_year", "listings.price_in_hkd", "listings.latitude", "listings.longitude", "listings.has_feature_personal_garden", "listings.contact_phone_2", "listings.currency_alphabetic_code", "listings.whatsapp_contact_phone", "listings.lister_speaking_languages"],
      "Shared Hit Blocks": 128,
      "Shared Read Blocks": 0,
      "Shared Dirtied Blocks": 0,
      "Shared Written Blocks": 0,
      "Local Hit Blocks": 0,
      "Local Read Blocks": 0,
      "Local Dirtied Blocks": 0,
      "Local Written Blocks": 0,
      "Temp Read Blocks": 0,
      "Temp Written Blocks": 0,
      "I/O Read Time": 0.000,
      "I/O Write Time": 0.000,
      "Plans": [
        {
          "Node Type": "Index Scan",
          "Parent Relationship": "Outer",
          "Parallel Aware": false,
          "Scan Direction": "Forward",
          "Index Name": "idx_listings_on_s_expired_at_n_stuff_4_rental_201807121108",
          "Relation Name": "listings",
          "Schema": "public",
          "Alias": "listings",
          "Startup Cost": 0.63,
          "Total Cost": 2725.80,
          "Plan Rows": 13035,
          "Plan Width": 813,
          "Actual Startup Time": 0.221,
          "Actual Total Time": 3.765,
          "Actual Rows": 120,
          "Actual Loops": 1,
          "Output": ["listings.id", "listings.block", "listings.flat", "listings.gross_area", "listings.net_area", "listings.price", "listings.description", "listings.about", "listings.bedrooms_count", "listings.bathrooms_count", "listings.contact_name", "listings.contact_phone", "listings.contact_email", "listings.source_url", "listings.is_rental", "listings.is_listed_by_agent", "listings.building_id", "listings.created_at", "listings.updated_at", "listings.agency_id", "listings.max_sale_price", "listings.min_sale_price", "listings.avg_sale_price", "listings.max_rental_price", "listings.min_rental_price", "listings.avg_rental_price", "listings.max_annual_percentage_yield", "listings.min_annual_percentage_yield", "listings.avg_annual_percentage_yield", "listings.last_calculate_estimate_at", "listings.floor", "listings.avg_price_to_estimate_diff_percentage", "listings.has_feature_car_park", "listings.has_feature_balcony", "listings.has_feature_sea_view", "listings.has_feature_roof", "listings.has_feature_club_house", "listings.has_feature_gym", "listings.has_feature_pool", "listings.has_feature_tennis", "listings.scraping_source_name", "listings.expired_at", "listings.remote_reference_id", "listings.updated_from_remote_source_at", "listings.property_images_count", "listings.click_contact_count", "listings.agent_license_number", "listings.send_contact_email_count", "listings.searching_expired_at", "listings.user_id", "listings.posted_at", "listings.serviced_apartment_provider_building_relationship_id", "listings.has_view_open", "listings.has_view_mountain", "listings.has_view_city", "listings.has_view_racecourse", "listings.has_view_sea", "listings.has_view_garden", "listings.has_view_building", "listings.has_feature_lift", "listings.has_feature_terrace", "listings.has_feature_maids_quarters", "listings.has_feature_garden", "listings.has_feature_pet_friendly", "listings.near_mtr", "listings.has_feature_duplex", "listings.short_rental", "listings.last_renovated", "listings.parking_count", "listings.furnished", "listings.property_agency_team_id", "listings.is_hdb", "listings.property_type", "listings.avg_rental_price_30_days_ago", "listings.avg_sale_price_30_days_ago", "listings.flat_share_allowed", "listings.confirmed_by_poster_at", "listings.source_white_label_real_estate_agency_id", "listings.quality_score", "listings.land_holding_area_size", "listings.marked_as_featured_at", "listings.average_price_per_area_size_unit", "listings.property_type_identifier", "listings.current_price_to_latest_estimated_price_diff_in_percentage", "listings.estimated_percentage_yield", "listings.is_type_commercial_shop", "listings.is_type_commercial_office", "listings.is_type_commercial_industrial", "listings.extra_attributes_json", "listings.price_max_to_min_diff_percentage", "listings.own_in_company_structure", "listings.occupy_by_tenant", "listings.spacious_business_center_entry_id", "listings.neighbourhood_id", "listings.count_of_tracking_event_with_view_page_type", "listings.self_updated_at", "listings.count_of_enquiries_for_trending_listing_notification", "listings.self_updated_at_after_posted_at_in_seconds", "listings.bedroom_count_updated_at", "listings.net_area_size_updated_at", "listings.price_significantly_updated_at", "listings.original_listing_id", "listings.duplication_state_updated_at", "listings.logical_posted_at", "listings.attrs_4_listing_related_digests_updated_at", "listings.city_id", "listings.building_type_identifier", "listings.paused_at", "listings.video_id", "listings.property_images_updated_at", "listings.poster_input_updated_at", "listings.building_built_year", "listings.price_in_hkd", "listings.latitude", "listings.longitude", "listings.has_feature_personal_garden", "listings.contact_phone_2", "listings.currency_alphabetic_code", "listings.whatsapp_contact_phone", "listings.lister_speaking_languages"],
          "Index Cond": "((listings.searching_expired_at >= '2019-08-14 00:00:00'::timestamp without time zone) AND (listings.searching_expired_at <= '3019-08-14 00:00:00'::timestamp without time zone) AND (listings.posted_at IS NOT NULL))",
          "Rows Removed by Index Recheck": 0,
          "Filter": "(NOT (hashed SubPlan 1))",
          "Rows Removed by Filter": 0,
          "Shared Hit Blocks": 128,
          "Shared Read Blocks": 0,
          "Shared Dirtied Blocks": 0,
          "Shared Written Blocks": 0,
          "Local Hit Blocks": 0,
          "Local Read Blocks": 0,
          "Local Dirtied Blocks": 0,
          "Local Written Blocks": 0,
          "Temp Read Blocks": 0,
          "Temp Written Blocks": 0,
          "I/O Read Time": 0.000,
          "I/O Write Time": 0.000,
          "Plans": [
            {
              "Node Type": "Nested Loop",
              "Parent Relationship": "SubPlan",
              "Subplan Name": "SubPlan 1",
              "Parallel Aware": false,
              "Join Type": "Inner",
              "Startup Cost": 0.11,
              "Total Cost": 0.52,
              "Plan Rows": 1,
              "Plan Width": 4,
              "Actual Startup Time": 0.047,
              "Actual Total Time": 0.048,
              "Actual Rows": 0,
              "Actual Loops": 1,
              "Output": ["listing_characteristics.listing_id"],
              "Inner Unique": true,
              "Shared Hit Blocks": 2,
              "Shared Read Blocks": 0,
              "Shared Dirtied Blocks": 0,
              "Shared Written Blocks": 0,
              "Local Hit Blocks": 0,
              "Local Read Blocks": 0,
              "Local Dirtied Blocks": 0,
              "Local Written Blocks": 0,
              "Temp Read Blocks": 0,
              "Temp Written Blocks": 0,
              "I/O Read Time": 0.000,
              "I/O Write Time": 0.000,
              "Plans": [
                {
                  "Node Type": "Index Scan",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Scan Direction": "Forward",
                  "Index Name": "index_listing_characteristics_on_identifier",
                  "Relation Name": "listing_characteristics",
                  "Schema": "public",
                  "Alias": "listing_characteristics_1",
                  "Startup Cost": 0.06,
                  "Total Cost": 0.26,
                  "Plan Rows": 1,
                  "Plan Width": 4,
                  "Actual Startup Time": 0.047,
                  "Actual Total Time": 0.047,
                  "Actual Rows": 0,
                  "Actual Loops": 1,
                  "Output": ["listing_characteristics_1.id", "listing_characteristics_1.identifier", "listing_characteristics_1.boolean_value", "listing_characteristics_1.string_value", "listing_characteristics_1.time_value", "listing_characteristics_1.integer_value", "listing_characteristics_1.listing_id", "listing_characteristics_1.created_at", "listing_characteristics_1.updated_at"],
                  "Index Cond": "(listing_characteristics_1.identifier = 'spacious_client__weave_coliving__2019_08_price_test__price_version'::text)",
                  "Rows Removed by Index Recheck": 0,
                  "Filter": "(listing_characteristics_1.string_value = 'lower_price'::text)",
                  "Rows Removed by Filter": 0,
                  "Shared Hit Blocks": 2,
                  "Shared Read Blocks": 0,
                  "Shared Dirtied Blocks": 0,
                  "Shared Written Blocks": 0,
                  "Local Hit Blocks": 0,
                  "Local Read Blocks": 0,
                  "Local Dirtied Blocks": 0,
                  "Local Written Blocks": 0,
                  "Temp Read Blocks": 0,
                  "Temp Written Blocks": 0,
                  "I/O Read Time": 0.000,
                  "I/O Write Time": 0.000
                },
                {
                  "Node Type": "Index Scan",
                  "Parent Relationship": "Inner",
                  "Parallel Aware": false,
                  "Scan Direction": "Forward",
                  "Index Name": "listing_characteristics_pkey",
                  "Relation Name": "listing_characteristics",
                  "Schema": "public",
                  "Alias": "listing_characteristics",
                  "Startup Cost": 0.06,
                  "Total Cost": 0.26,
                  "Plan Rows": 1,
                  "Plan Width": 8,
                  "Actual Startup Time": 0.000,
                  "Actual Total Time": 0.000,
                  "Actual Rows": 0,
                  "Actual Loops": 0,
                  "Output": ["listing_characteristics.id", "listing_characteristics.identifier", "listing_characteristics.boolean_value", "listing_characteristics.string_value", "listing_characteristics.time_value", "listing_characteristics.integer_value", "listing_characteristics.listing_id", "listing_characteristics.created_at", "listing_characteristics.updated_at"],
                  "Index Cond": "(listing_characteristics.id = listing_characteristics_1.id)",
                  "Rows Removed by Index Recheck": 0,
                  "Shared Hit Blocks": 0,
                  "Shared Read Blocks": 0,
                  "Shared Dirtied Blocks": 0,
                  "Shared Written Blocks": 0,
                  "Local Hit Blocks": 0,
                  "Local Read Blocks": 0,
                  "Local Dirtied Blocks": 0,
                  "Local Written Blocks": 0,
                  "Temp Read Blocks": 0,
                  "Temp Written Blocks": 0,
                  "I/O Read Time": 0.000,
                  "I/O Write Time": 0.000
                }
              ]
            }
          ]
        }
      ]
    },
    "Planning Time": 12.613,
    "Triggers": [
    ],
    "Execution Time": 3.892
  }
]

An in-range update of core-js is breaking the build ๐Ÿšจ

The dependency core-js was updated from 3.4.1 to 3.4.2.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

core-js is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for 3.4.2 - 2019.11.22
  • Don't use polyfilled symbols as internal uids, a workaround for some incorrect use cases
  • String#replaceAll is available only in nightly FF builds
  • Improved Promise feature detection for the case of V8 6.6 with multiple core-js copies
  • Some internals optimizations
  • Added Node 13.2 -> V8 7.9 compat data mapping
  • Returned usage of node -e in postinstall scripts
FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

Accept plan with \x on

Small enhancement:
If an EXPLAIN follows a \x on (which is rather common when looking at data), you get a plan like the one below. pev2 cannot parse it, although it seems rather easy to remove the [ RECORD ] lines and the QUERY_PLAN header.

postgres@partitions_0=# \x on
postgres@partitions_0=# explain (buffers, analyze) insert into deux_gigalignes select * from un_gigaligne union all select 1e9+i, x from un_gigaligne ;
-[ RECORD 1 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN | Insert on deux_gigalignes  (cost=0.00..93310812.00 rows=2000000000 width=16) (actual time=2828176.865..2828176.865 rows=0 loops=1)
-[ RECORD 2 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |   Buffers: shared hit=2021632336 read=10813452 dirtied=10797519 written=10797518
-[ RECORD 3 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |   I/O Timings: read=675773.919
-[ RECORD 4 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |   ->  Subquery Scan on "*SELECT*"  (cost=0.00..93310812.00 rows=2000000000 width=16) (actual time=36.444..1467607.545 rows=2000000000 loops=1)
-[ RECORD 5 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |         Buffers: shared hit=13 read=10810799
-[ RECORD 6 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |         I/O Timings: read=675768.478
-[ RECORD 7 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |         ->  Append  (cost=0.00..68310812.00 rows=2000000000 width=40) (actual time=36.440..1224045.798 rows=2000000000 loops=1)
-[ RECORD 8 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |               Buffers: shared hit=13 read=10810799
-[ RECORD 9 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |               I/O Timings: read=675768.478
-[ RECORD 10 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |               ->  Subquery Scan on "*SELECT* 1"  (cost=0.00..27905406.00 rows=1000000000 width=40) (actual time=36.439..541658.266 rows=1000000000 loops=1)
-[ RECORD 11 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |                     Buffers: shared hit=13 read=5405393
-[ RECORD 12 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |                     I/O Timings: read=327133.714
-[ RECORD 13 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |                     ->  Seq Scan on un_gigaligne  (cost=0.00..15405406.00 rows=1000000000 width=16) (actual time=0.009..404106.083 rows=1000000000 loops=1)
-[ RECORD 14 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |                           Buffers: shared hit=13 read=5405393
-[ RECORD 15 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |                           I/O Timings: read=327133.714
-[ RECORD 16 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |               ->  Seq Scan on un_gigaligne un_gigaligne_1  (cost=0.00..20405406.00 rows=1000000000 width=40) (actual time=0.018..559740.251 rows=1000000000 loops=1)
-[ RECORD 17 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |                     Buffers: shared read=5405406
-[ RECORD 18 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |                     I/O Timings: read=348634.764
-[ RECORD 19 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN | Planning Time: 0.052 ms
-[ RECORD 20 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN | JIT:
-[ RECORD 21 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |   Functions: 5
-[ RECORD 22 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |   Options: Inlining true, Optimization true, Expressions true, Deforming true
-[ RECORD 23 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN |   Timing: Generation 0.476 ms, Inlining 3.328 ms, Optimization 20.725 ms, Emission 12.283 ms, Total 36.812 ms
-[ RECORD 24 ]-------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN | Execution Time: 2828177.400 ms

Durรฉe : 2828254,565 ms (47:08,255)

Parallel workers not shown when ANALYZE missing

The following plan has no ANALYZE.

The graph generated by PEV2 has 2 problems:

  • There is a warning "Not all workers launched", which is a bit strange in this context, given that the query was not executed at all.
  • There is no graphical hint (stacked nodes) that shows parallel workers. This is a shame as it's not always obvious when parallelism is activated or not, and PEV2 could be used to test plans before executing them. So I suggest that when there is no "Workers Launched" node, the number "Workers Planned" should be shown.
    (Optional : workers planned could be shown in a different form that launched workers : dots, different colors...)
 explain select count(*) from bigtable ;
                                           QUERY PLAN                                           
------------------------------------------------------------------------------------------------
 Finalize Aggregate  (cost=2734224.57..2734224.58 rows=1 width=8)
   ->  Gather  (cost=2734223.33..2734224.54 rows=12 width=8)
         Workers Planned: 12
         ->  Partial Aggregate  (cost=2733223.33..2733223.34 rows=1 width=8)
               ->  Parallel Seq Scan on bigtable  (cost=0.00..2629056.67 rows=41666667 width=0)
 JIT:
   Functions: 4
   Options: Inlining true, Optimization true, Expressions true, Deforming true
(8 lignes)

Temps : 2,849 ms

JIT time

JIT compilation time can appear since v11.

It should appear next to the Planning time.

It is negligible in this case:

explain (analyze) select * from bigtable_0 where id < 5000000 and x >0.5 ;
                                                      QUERY PLAN                                                       
-----------------------------------------------------------------------------------------------------------------------
 Seq Scan on bigtable_0  (cost=0.00..109624.00 rows=1666500 width=8) (actual time=1.619..620.253 rows=4999993 loops=1)
   Filter: ((id < 5000000) AND ((x)::numeric > 0.5))
   Rows Removed by Filter: 7
 Planning Time: 0.048 ms
 JIT:
   Functions: 2
   Options: Inlining false, Optimization false, Expressions true, Deforming true
   Timing: Generation 0.244 ms, Inlining 0.000 ms, Optimization 0.121 ms, Emission 1.397 ms, Total 1.762 ms
 Execution Time: 731.231 ms
(9 lignes)

It is a problem in this case (jit_*cost set to 0) :

 explain (analyze) select * from bigtable_0 where id < 1000000 and x >0.5 and x+0<1 and x > -2 and x+0 >0 ;
                                                               QUERY PLAN                                                                
-----------------------------------------------------------------------------------------------------------------------------------------
 Gather  (cost=1010.54..33090.24 rows=1664 width=8) (actual time=119.788..124.388 rows=0 loops=1)
   Workers Planned: 3
   Workers Launched: 3
   ->  Parallel Bitmap Heap Scan on bigtable_0  (cost=10.54..31923.84 rows=537 width=8) (actual time=91.184..91.184 rows=0 loops=4)
         Recheck Cond: (id < 1000000)
         Rows Removed by Index Recheck: 3120
         Filter: ((x > '-2'::integer) AND ((x)::numeric > 0.5) AND ((x + 0) < 1) AND ((x + 0) > 0))
         Rows Removed by Filter: 250000
         Heap Blocks: lossy=2479
         ->  Bitmap Index Scan on bigtable_0_brin  (cost=0.00..10.12 rows=1011561 width=0) (actual time=0.744..0.744 rows=44800 loops=1)
               Index Cond: (id < 1000000)
 Planning Time: 0.207 ms
 JIT:
   Functions: 16
   Options: Inlining true, Optimization true, Expressions true, Deforming true
   Timing: Generation 4.002 ms, Inlining 131.757 ms, Optimization 85.466 ms, Emission 39.172 ms, Total 260.397 ms
 Execution Time: 126.039 ms
(17 lignes)

Temps : 129,026 ms

As the official doc is scarse on the meaning of Generation/Inlining/Emission, I would consider only the Total. Strangely it may be > execution time ?!

Parallel Execution inside CTE

"stacked cards" view for parallel nodes are not showing when executed inside a CTE.

Also Partial aggregates could be identified differently, since they are running in parallel workers.

Plans and query: https://pastebin.com/FZua2AUs

EDIT: It's behind the CTE panel.
image

Ratio between 'Actual rows' and 'Rows Removed by Filter'

A very small ratio between returned rows and the total number of scanned rows (not shown in the plan but available as Actual rows + Rows Removed by Filter) is an indication that an index might be a good idea, so an hint should appear somewhere.

In a 1st time, add a percentage of filtered on the same line as "Rows removed by Filter" (something like ">99.99%" in the following example), and "Actual rows" ("<0.01%" here).
Rounding: 2 digits ("25%") is fine, but when you get very close to 0% or 99% you should not round to 0% or 100% (except if 0 or all lines are filtered of course).
I'm wondering if it should be "99.99.% of the scanned rows" to avoid confusion with "99.99% of the table" (which would be another )

(BTW : add a "Total scanned rows" line ?)

In a 2nd time, add something in the same vein as "overestimated rows by ..." in the default view of the node. I don't know which color to use and suggest that an index would be useful, there is no real rule there (orange for 80% of removed lines ? 90% ?)

1st example (without parallelism) : 1 line is returned among 1 million.

 select * from t_un_million_int where i+0 = 500000 ;
 Seq Scan on t_un_million_int  (cost=0.00..19425.00 rows=5000 width=4) (actual time=66.075..101.704 rows=1 loops=1)
   Filter: ((i + 0) = 500000)
   Rows Removed by Filter: 999999
 Planning Time: 0.153 ms
 Execution Time: 101.755 ms
(5 lignes)

Same query, with parallelism: Removed lines are to be multiplied by 3 total workers, and Actual rows should come from Gather node, not from the parallel scans (average is zero):

 Gather  (cost=1000.00..12175.00 rows=5000 width=4) (actual time=124.521..127.080 rows=1 loops=1)
   Workers Planned: 2
   Workers Launched: 2
   ->  Parallel Seq Scan on t_un_million_int  (cost=0.00..10675.00 rows=2083 width=4) (actual time=97.027..111.253 rows=0 loops=3)
         Filter: ((i + 0) = 500000)
         Rows Removed by Filter: 333333
 Planning Time: 0.179 ms
 Execution Time: 127.128 ms
(8 lignes)

2nd query, with intermediate index: it should show "Rows Removed by Filter: 95% of scanned rows" (20/21)

explain (analyze) select * from t_un_million_int where i between 499990 and 500010 and i+0 =500000  ;
                                                                 QUERY PLAN                                                                  
---------------------------------------------------------------------------------------------------------------------------------------------
 Index Only Scan using t_un_million_int_pkey on t_un_million_int  (cost=0.42..1.93 rows=1 width=4) (actual time=0.058..0.065 rows=1 loops=1)
   Index Cond: ((i >= 499990) AND (i <= 500010))
   Filter: ((i + 0) = 500000)
   Rows Removed by Filter: 20
   Heap Fetches: 0
 Planning Time: 0.228 ms
 Execution Time: 0.126 ms
(7 lignes)

Isolate CTE

Make it so CTE (and init plans) are not visualy connected to the root node.

unable to parse plan 2

Error: Couldn't parse the plan

GroupAggregate  (cost=370159.25..485439.43 rows=1537069 width=151) (actual time=1574.067..1617.704 rows=1627 loops=1)
  Group Key: (to_char(timezone('America/Sao_Paulo'::text, reg.data_hora), 'yyyy-MM-dd'::text)), s.nome_simulacao, potgerada.potencia, qtdturbina.qtd, (CASE WHEN (isallaborted.qtdaborted IS NULL) THEN false ELSE (count(reg_all_aborted.id) = isallaborted.qtd (...)
  ->  Sort  (cost=370159.25..374001.93 rows=1537069 width=102) (actual time=1574.021..1580.820 rows=68257 loops=1)
        Sort Key: (to_char(timezone('America/Sao_Paulo'::text, reg.data_hora), 'yyyy-MM-dd'::text)), s.nome_simulacao, potgerada.potencia, qtdturbina.qtd, (CASE WHEN (isallaborted.qtdaborted IS NULL) THEN false ELSE (count(reg_all_aborted.id) = isallaborte (...)
        Sort Method: external sort  Disk: 4936kB
        ->  Hash Join  (cost=30266.60..44092.96 rows=1537069 width=102) (actual time=1011.757..1175.177 rows=68257 loops=1)
              Hash Cond: (potgerada.potdata = qtdturbina.qtddata)
              ->  Hash Join  (cost=22688.32..27381.09 rows=540268 width=134) (actual time=849.432..905.275 rows=68257 loops=1)
                    Hash Cond: ((to_char(timezone('America/Sao_Paulo'::text, reg_all_aborted.data_hora), 'yyyy-MM-dd'::text)) = potgerada.potdata)
                    ->  Merge Join  (cost=15176.79..19360.52 rows=189893 width=70) (actual time=717.059..752.849 rows=68257 loops=1)
                          Merge Cond: ((to_char(timezone('America/Sao_Paulo'::text, reg_all_aborted.data_hora), 'yyyy-MM-dd'::text)) = (to_char(timezone('America/Sao_Paulo'::text, reg.data_hora), 'yyyy-MM-dd'::text)))
                          ->  GroupAggregate  (cost=6492.75..6728.57 rows=8575 width=41) (actual time=128.422..130.784 rows=365 loops=1)
                                Group Key: (to_char(timezone('America/Sao_Paulo'::text, reg_all_aborted.data_hora), 'yyyy-MM-dd'::text)), isallaborted.qtdaborted
                                ->  Sort  (cost=6492.75..6514.19 rows=8575 width=48) (actual time=128.410..128.958 rows=8736 loops=1)
                                      Sort Key: (to_char(timezone('America/Sao_Paulo'::text, reg_all_aborted.data_hora), 'yyyy-MM-dd'::text)), isallaborted.qtdaborted
                                      Sort Method: quicksort  Memory: 1067kB
                                      ->  Hash Left Join  (cost=2029.75..5932.55 rows=8575 width=48) (actual time=24.646..118.880 rows=8736 loops=1)
                                            Hash Cond: (to_char(timezone('America/Sao_Paulo'::text, reg_all_aborted.data_hora), 'yyyy-MM-dd'::text) = isallaborted.allaborteddata)
                                            ->  Gather  (cost=1000.00..4858.25 rows=569 width=16) (actual time=15.946..87.840 rows=8736 loops=1)
                                                  Workers Planned: 1
                                                  Workers Launched: 1
                                                  ->  Parallel Seq Scan on registro reg_all_aborted  (cost=0.00..3801.35 rows=335 width=16) (actual time=14.423..94.504 rows=4368 loops=2)
                                                        Filter: ((usina_id = 1) AND (timezone('America/Sao_Paulo'::text, data_hora) >= to_timestamp('2010-01-01'::text, 'yyyy-MM-dd-HH24:MI'::text)) AND (timezone('America/Sao_Paulo'::text, data_hora) <= to_t (...)
                                                        Rows Removed by Filter: 52578
                                            ->  Hash  (cost=992.07..992.07 rows=3014 width=40) (actual time=8.680..8.680 rows=2290 loops=1)
                                                  Buckets: 4096  Batches: 1  Memory Usage: 147kB
                                                  ->  Subquery Scan on isallaborted  (cost=916.72..992.07 rows=3014 width=40) (actual time=7.580..8.221 rows=2290 loops=1)
                                                        ->  HashAggregate  (cost=916.72..961.93 rows=3014 width=40) (actual time=7.579..7.978 rows=2290 loops=1)
                                                              Group Key: to_char(timezone('America/Sao_Paulo'::text, inner_reg_all_aborted.data_hora), 'yyyy-MM-dd'::text)
                                                              ->  Index Scan using idx_registro_abortado on registro inner_reg_all_aborted  (cost=0.42..901.65 rows=3014 width=33) (actual time=0.027..6.350 rows=3066 loops=1)
                                                                    Index Cond: (abortado = true)
                                                                    Filter: ((abortado IS TRUE) AND (usina_id = 1))
                          ->  Sort  (cost=8684.03..8695.11 rows=4429 width=37) (actual time=588.628..603.447 rows=68257 loops=1)
                                Sort Key: (to_char(timezone('America/Sao_Paulo'::text, reg.data_hora), 'yyyy-MM-dd'::text))
                                Sort Method: external sort  Disk: 4200kB
                                ->  Gather  (cost=1000.85..8415.80 rows=4429 width=37) (actual time=16.311..232.445 rows=68257 loops=1)
                                      Workers Planned: 1
                                      Workers Launched: 1
                                      ->  Nested Loop Left Join  (cost=0.84..6972.90 rows=2605 width=37) (actual time=14.557..168.630 rows=34128 loops=2)
                                            ->  Parallel Seq Scan on registro reg  (cost=0.00..3801.35 rows=335 width=16) (actual time=14.514..101.707 rows=4368 loops=2)
                                                  Filter: ((usina_id = 1) AND (timezone('America/Sao_Paulo'::text, data_hora) >= to_timestamp('2010-01-01'::text, 'yyyy-MM-dd-HH24:MI'::text)) AND (timezone('America/Sao_Paulo'::text, data_hora) <= to_timesta (...)
                                                  Rows Removed by Filter: 52578
                                            ->  Nested Loop  (cost=0.84..9.39 rows=8 width=37) (actual time=0.006..0.014 rows=8 loops=8736)
                                                  ->  Index Scan using idx_turbina_registro on turbina turbvalida  (cost=0.42..7.65 rows=2 width=22) (actual time=0.003..0.004 rows=2 loops=8736)
                                                        Index Cond: (reg.id = registro_id)
                                                  ->  Index Scan using idx_simulacao_turbina on simulacao s  (cost=0.42..0.83 rows=4 width=31) (actual time=0.002..0.004 rows=4 loops=17472)
                                                        Index Cond: (turbina_id = turbvalida.id)
                    ->  Hash  (cost=7504.42..7504.42 rows=569 width=64) (actual time=132.363..132.363 rows=365 loops=1)
                          Buckets: 1024  Batches: 1  Memory Usage: 28kB
                          ->  Subquery Scan on potgerada  (cost=7405.51..7504.42 rows=569 width=64) (actual time=129.027..132.274 rows=365 loops=1)
                                ->  Finalize GroupAggregate  (cost=7405.51..7498.73 rows=569 width=64) (actual time=129.026..132.220 rows=365 loops=1)
                                      Group Key: (to_char(timezone('America/Sao_Paulo'::text, regpotgerada.data_hora), 'yyyy-MM-dd'::text))
                                      ->  Gather Merge  (cost=7405.51..7484.51 rows=569 width=64) (actual time=129.009..131.650 rows=501 loops=1)
                                            Workers Planned: 1
                                            Workers Launched: 1
                                            ->  Partial GroupAggregate  (cost=6405.50..6420.49 rows=569 width=64) (actual time=127.206..129.522 rows=250 loops=2)
                                                  Group Key: (to_char(timezone('America/Sao_Paulo'::text, regpotgerada.data_hora), 'yyyy-MM-dd'::text))
                                                  ->  Sort  (cost=6405.50..6407.17 rows=671 width=38) (actual time=127.187..127.597 rows=8736 loops=2)
                                                        Sort Key: (to_char(timezone('America/Sao_Paulo'::text, regpotgerada.data_hora), 'yyyy-MM-dd'::text))
                                                        Sort Method: quicksort  Memory: 1014kB
                                                        ->  Nested Loop  (cost=0.42..6373.99 rows=671 width=38) (actual time=14.705..124.598 rows=8736 loops=2)
                                                              ->  Parallel Seq Scan on registro regpotgerada  (cost=0.00..3801.35 rows=335 width=16) (actual time=14.634..95.471 rows=4368 loops=2)
                                                                    Filter: ((usina_id = 1) AND (timezone('America/Sao_Paulo'::text, data_hora) >= to_timestamp('2010-01-01'::text, 'yyyy-MM-dd-HH24:MI'::text)) AND (timezone('America/Sao_Paulo'::text, data_h (...)
                                                                    Rows Removed by Filter: 52578
                                                              ->  Index Scan using idx_turbina_registro on turbina turbpotgerada  (cost=0.42..7.65 rows=2 width=14) (actual time=0.002..0.003 rows=2 loops=8736)
                                                                    Index Cond: (registro_id = regpotgerada.id)
              ->  Hash  (cost=7571.17..7571.17 rows=569 width=40) (actual time=162.302..162.302 rows=365 loops=1)
                    Buckets: 1024  Batches: 1  Memory Usage: 27kB
                    ->  Subquery Scan on qtdturbina  (cost=7548.38..7571.17 rows=569 width=40) (actual time=155.928..162.190 rows=365 loops=1)
                          ->  GroupAggregate  (cost=7548.38..7565.48 rows=569 width=40) (actual time=155.927..162.128 rows=365 loops=1)
                                Group Key: (to_char(timezone('America/Sao_Paulo'::text, regqtdturbina.data_hora), 'yyyy-MM-dd'::text))
                                ->  Sort  (cost=7548.38..7551.24 rows=1141 width=42) (actual time=155.889..156.749 rows=17472 loops=1)
                                      Sort Key: (to_char(timezone('America/Sao_Paulo'::text, regqtdturbina.data_hora), 'yyyy-MM-dd'::text))
                                      Sort Method: quicksort  Memory: 2134kB
                                      ->  Gather  (cost=1000.42..7490.44 rows=1141 width=42) (actual time=19.709..136.804 rows=17472 loops=1)
                                            Workers Planned: 1
                                            Workers Launched: 1
                                            ->  Nested Loop  (cost=0.42..6373.99 rows=671 width=42) (actual time=16.545..131.207 rows=8736 loops=2)
                                                  ->  Parallel Seq Scan on registro regqtdturbina  (cost=0.00..3801.35 rows=335 width=16) (actual time=16.469..100.647 rows=4368 loops=2)
                                                        Filter: ((usina_id = 1) AND (timezone('America/Sao_Paulo'::text, data_hora) >= to_timestamp('2010-01-01'::text, 'yyyy-MM-dd-HH24:MI'::text)) AND (timezone('America/Sao_Paulo'::text, data_hora) <= to_t (...)
                                                        Rows Removed by Filter: 52578
                                                  ->  Index Scan using idx_turbina_registro on turbina  (cost=0.42..7.65 rows=2 width=18) (actual time=0.002..0.003 rows=2 loops=8736)
                                                        Index Cond: (registro_id = regqtdturbina.id)
Planning time: 2.976 ms
Execution time: 1619.764 ms

Link between a node and a line in the SQL query

(As discussed together)

The small blue icon links to a part in the query. This is inherited from PEV and often false, because PG rewrites parts of the query, including the filter.

Question is: is it possible to improve this to be really useful.

Personally, i' d really like to have this.

Name of the plan in the window

When comparing 2 plans in 2 windows, it would be nice a name somewhere to remember which is which.

There is a "title" field in explain.dalibo.com, but it appears only in the browser tab name, so it's lost in a screenshot or a print.

Text plan lacking indentation leads to incomplete parsing

If there's no indentation in a plan in text format, PEV2 tends to fail doing the parsing. Actually it is unable to find more than one node.

Nested Loop Left Join  (cost=11.95..28.52 rows=5 width=157) (actual time=0.010..0.010 rows=0 loops=1)
Output: rel_users_exams.user_username, rel_users_exams.exam_id, rel_users_exams.started_at, rel_users_exams.finished_at, exam_1.id, exam_1.title, exam_1.date_from, exam_1.date_to, exam_1.created, exam_1.created_by_, exam_1.duration, exam_1.success_threshold, exam_1.published
Inner Unique: true
Join Filter: (exam_1.id = rel_users_exams.exam_id)
Buffers: shared hit=1
->  Bitmap Heap Scan on public.rel_users_exams  (cost=11.80..20.27 rows=5 width=52) (actual time=0.009..0.009 rows=0 loops=1)
Output: rel_users_exams.user_username, rel_users_exams.exam_id, rel_users_exams.started_at, rel_users_exams.finished_at
Recheck Cond: (1 = rel_users_exams.exam_id)
Buffers: shared hit=1
->  Bitmap Index Scan on rel_users_exams_pkey  (cost=0.00..11.80 rows=5 width=0) (actual time=0.005..0.005 rows=0 loops=1)
Index Cond: (1 = rel_users_exams.exam_id)
Buffers: shared hit=1
->  Materialize  (cost=0.15..8.17 rows=1 width=105) (never executed)
Output: exam_1.id, exam_1.title, exam_1.date_from, exam_1.date_to, exam_1.created, exam_1.created_by_, exam_1.duration, exam_1.success_threshold, exam_1.published
->  Index Scan using exam_pkey on public.exam exam_1  (cost=0.15..8.17 rows=1 width=105) (never executed)
Output: exam_1.id, exam_1.title, exam_1.date_from, exam_1.date_to, exam_1.created, exam_1.created_by_, exam_1.duration, exam_1.success_threshold, exam_1.published
Index Cond: (exam_1.id = 1)
Planning Time: 1.110 ms
Execution Time: 0.170 ms

Depesz doesn't seem to fail. It's not perfect but better.
https://explain.depesz.com/s/DMXK

Here's the correctly indented plan:

Nested Loop Left Join  (cost=11.95..28.52 rows=5 width=157) (actual time=0.010..0.010 rows=0 loops=1)
  Output: rel_users_exams.user_username, rel_users_exams.exam_id, rel_users_exams.started_at, rel_users_exams.finished_at, exam_1.id, exam_1.title, exam_1.date_from, exam_1.date_to, exam_1.created, exam_1.created_by_, exam_1.duration, exam_1.success_threshold, exam_1.published
  Inner Unique: true
  Join Filter: (exam_1.id = rel_users_exams.exam_id)
  Buffers: shared hit=1
  ->  Bitmap Heap Scan on public.rel_users_exams  (cost=11.80..20.27 rows=5 width=52) (actual time=0.009..0.009 rows=0 loops=1)
        Output: rel_users_exams.user_username, rel_users_exams.exam_id, rel_users_exams.started_at, rel_users_exams.finished_at
        Recheck Cond: (1 = rel_users_exams.exam_id)
        Buffers: shared hit=1
        ->  Bitmap Index Scan on rel_users_exams_pkey  (cost=0.00..11.80 rows=5 width=0) (actual time=0.005..0.005 rows=0 loops=1)
              Index Cond: (1 = rel_users_exams.exam_id)
              Buffers: shared hit=1
  ->  Materialize  (cost=0.15..8.17 rows=1 width=105) (never executed)
        Output: exam_1.id, exam_1.title, exam_1.date_from, exam_1.date_to, exam_1.created, exam_1.created_by_, exam_1.duration, exam_1.success_threshold, exam_1.published
        ->  Index Scan using exam_pkey on public.exam exam_1  (cost=0.15..8.17 rows=1 width=105) (never executed)
              Output: exam_1.id, exam_1.title, exam_1.date_from, exam_1.date_to, exam_1.created, exam_1.created_by_, exam_1.duration, exam_1.success_threshold, exam_1.published
              Index Cond: (exam_1.id = 1)
Planning Time: 1.110 ms
Execution Time: 0.170 ms

Colors for Planning time

It may happen that the Planning time is the biggest problem, for example if there are too many partitions in v10/v11, or if join_collapse_limit is too high on a complex query.

Following the ratio between Planning and Execution time, Planning time should appear in green/orange/red/crimson, or show a coloured flag. Thresholds between colors are rather arbitrary (20%, 50%, 100%)

Same suggestion applies for the JIT time if it's added (#92 )

Example for a very bad planning time (10000 partitions, v11):

 explain (analyze,verbose) select  * from bigtable where id =5000000 ;
                                                              QUERY PLAN                                                               
---------------------------------------------------------------------------------------------------------------------------------------
 Append  (cost=12.03..545.46 rows=1 width=8) (actual time=1.308..1.308 rows=1 loops=1)
   ->  Bitmap Heap Scan on public.bigtable_99  (cost=12.03..545.46 rows=1 width=8) (actual time=1.307..1.308 rows=1 loops=1)
         Output: bigtable_99.id, bigtable_99.x
         Recheck Cond: (bigtable_99.id = 5000000)
         Rows Removed by Index Recheck: 21071
         Heap Blocks: lossy=94
         ->  Bitmap Index Scan on bigtable_99_brin  (cost=0.00..12.03 rows=24914 width=0) (actual time=0.008..0.008 rows=1280 loops=1)
               Index Cond: (bigtable_99.id = 5000000)
 Planning Time: 142.789 ms
 Execution Time: 1.637 ms
(10 lignes)

Temps : 165,138 ms

EXPLAIN without ANALYZE or with COSTS OFF fails

(Reported in private this morning.)

I get an empty window or an error message if ANALYZE if missing, or COSTS OFF present.
VERBOSE option seems okay.

This leads to an empty window (only with the buttons New Plan and About) only on https://dalibo.github.io/pev2/ (explain.dalibo.com works):

explain select * from pg_class ;
                         QUERY PLAN                          
-------------------------------------------------------------
 Seq Scan on pg_class  (cost=0.00..29.68 rows=568 width=773)

This fails with "Couldn't parse plan", on dalibo.github.io/pev2/ and explain.dalibo.com:

explain (analyze,costs off) select * from pg_class ;
                            QUERY PLAN                            
------------------------------------------------------------------
 Seq Scan on pg_class (actual time=0.013..0.181 rows=645 loops=1)
 Planning Time: 0.104 ms
 Execution Time: 0.289 ms
(3 lignes)

Workers Launched : 0 shows some parallelism

Minor bug:
No parallel workers is launched in the following plan. But stacked nodes still appear, suggesting that a parallel worker was used, which is not the case. So the graph seems the same that with Workers Launched:1

set max_parallel_workers to 0 ;

explain (analyze, buffers) select count(*) from bigtable ;
                                                                      QUERY PLAN                                                                      
------------------------------------------------------------------------------------------------------------------------------------------------------
 Finalize Aggregate  (cost=2734224.57..2734224.58 rows=1 width=8) (actual time=87739.624..87739.624 rows=1 loops=1)
   Buffers: shared hit=320 read=2212070
   I/O Timings: read=37561.374
   ->  Gather  (cost=2734223.33..2734224.54 rows=12 width=8) (actual time=87739.618..87739.747 rows=1 loops=1)
         Workers Planned: 12
         Workers Launched: 0
         Buffers: shared hit=320 read=2212070
         I/O Timings: read=37561.374
         ->  Partial Aggregate  (cost=2733223.33..2733223.34 rows=1 width=8) (actual time=87739.417..87739.418 rows=1 loops=1)
               Buffers: shared hit=320 read=2212070
               I/O Timings: read=37561.374
               ->  Parallel Seq Scan on bigtable  (cost=0.00..2629056.67 rows=41666667 width=0) (actual time=0.004..67886.549 rows=500000001 loops=1)
                     Buffers: shared hit=320 read=2212070
                     I/O Timings: read=37561.374
 Planning Time: 0.048 ms
 JIT:
   Functions: 4
   Options: Inlining true, Optimization true, Expressions true, Deforming true
   Timing: Generation 0.272 ms, Inlining 1.170 ms, Optimization 7.191 ms, Emission 6.075 ms, Total 14.709 ms
 Execution Time: 87740.073 ms
(20 lignes)

Docker build is broken

Hi,
I've followed the docker build/run instructions on CONTRIBUTING.md but I get an 403 - Forbidden error from Nginx.

Looking at the NGINX logs it seems there is an index.html file missing:

[error] 6#6: *9 rewrite or internal redirection cycle while internally redirecting to "/index.html"

Any idea how to fix this? I don't have a lot of experience with npm or Vue.js

Thanks!

Metrics & checkboxes

Is it possible to have all metrics as checkboxes, like 'Costs' currently ? I'd like to have all at once, especially when colors give quick hints.

I've thought of this because currently you can have a "Cost" box show twice if you choose Cost as metric and in the checkbox.

Show Heap Fetches from an Index Only Scan and warn when the value is high

In the following example (taken from J4), the VACUUM was forgotten, so the Index Only Scan must check the visibility of each row in the table heap (Heap Fetches = 100001). After a VACUUM, the visibility map is clean, and Heap Fetches goes down to 0 (which is the goal).

I'd like such inefficient Index Only Scans to appear. 'Heap Fetches' do appear when clicking on the node. A warning (orange color?) should appear above a certain level, that is hard to define. Perhaps 1 heap fetch per 100 scanned rows (Actual Rows+Rows Removed by Filter).

This example is a covering index, but this applies to all Index Only Scans.

CREATE TABLE t (id int NOT NULL, valeur int) ;

INSERT INTO t SELECT i, i*50 FROM generate_series(1,1000000) i;

CREATE UNIQUE INDEX t_pk ON t (id) INCLUDE (valeur) ;

EXPLAIN (ANALYZE,BUFFERS) SELECT valeur FROM t WHERE id between 800000 and 900000 ;
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Index Only Scan using t_pk on t  (cost=0.42..2681.27 rows=98642 width=4) (actual time=0.046..52.086 rows=100001 loops=1)
   Index Cond: ((id >= 800000) AND (id <= 900000))
   Heap Fetches: 100001
   Buffers: shared hit=721
 Planning Time: 0.209 ms
 Execution Time: 60.922 ms
(6 lignes)


EXPLAIN (ANALYZE,BUFFERS) SELECT valeur FROM t WHERE id between 800000 and 900000 ;
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Index Only Scan using t_pk on t  (cost=0.42..2244.27 rows=98642 width=4) (actual time=0.062..33.797 rows=100001 loops=1)
   Index Cond: ((id >= 800000) AND (id <= 900000))
   Heap Fetches: 0
   Buffers: shared hit=278
 Planning Time: 0.279 ms
 Execution Time: 45.054 ms
(6 lignes)

Another example with many Heap Fetches and some filtered rows :

 EXPLAIN (ANALYZE,BUFFERS) SELECT valeur FROM t WHERE id between 800000 and 900000 and mod(id,2)=0;
                                                      QUERY PLAN                                                       
-----------------------------------------------------------------------------------------------------------------------
 Index Only Scan using t_pk on t  (cost=0.42..2824.32 rows=506 width=4) (actual time=0.027..29.694 rows=50001 loops=1)
   Index Cond: ((id >= 800000) AND (id <= 900000))
   Filter: (mod(id, 2) = 0)
   Rows Removed by Filter: 50000
   Heap Fetches: 50155
   Buffers: shared hit=50417
 Planning Time: 0.096 ms
 Execution Time: 31.994 ms
(8 lignes)

toPrecision JS error

The following error TypeError: Cannot read property 'toPrecision' of undefined sometimes show up when trying to display estimations (for example with the first sample).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.