explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wcpu

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 116.337 ↑ 423.0 4 1

Sort (cost=27,045.84..27,050.07 rows=1,692 width=156) (actual time=116.336..116.337 rows=4 loops=1)

  • Sort Key: r.res_descricao, ta.tab_descricao
  • Sort Method: quicksort Memory: 25kB
2. 0.134 116.320 ↑ 423.0 4 1

HashAggregate (cost=26,908.58..26,955.11 rows=1,692 width=156) (actual time=116.309..116.320 rows=4 loops=1)

  • Group Key: r.res_descricao, ta.tab_descricao
3. 39.380 116.186 ↑ 157.9 163 1

Hash Join (cost=13,187.76..26,458.15 rows=25,739 width=44) (actual time=90.582..116.186 rows=163 loops=1)

  • Hash Cond: ((a.res_chave = r.res_chave) AND (a.esc_combustivel = ta.tab_codigo))
4. 32.737 32.737 ↑ 1.0 394,400 1

Seq Scan on estoquecomb a (cost=0.00..10,055.00 rows=394,400 width=15) (actual time=0.011..32.737 rows=394,400 loops=1)

5. 0.000 44.069 ↑ 34.8 9 1

Hash (cost=13,183.06..13,183.06 rows=313 width=61) (actual time=44.069..44.069 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 8.187 44.134 ↑ 34.8 9 1

Gather Merge (cost=13,141.31..13,183.06 rows=313 width=61) (actual time=44.029..44.134 rows=9 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 0.032 35.947 ↑ 43.3 3 3 / 3

Merge Join (cost=12,141.28..12,146.91 rows=130 width=61) (actual time=35.936..35.947 rows=3 loops=3)

  • Merge Cond: (ec.res_chave = r.res_chave)
8. 0.020 35.601 ↑ 43.3 3 3 / 3

Sort (cost=12,088.75..12,089.07 rows=130 width=34) (actual time=35.601..35.601 rows=3 loops=3)

  • Sort Key: ec.res_chave
  • Sort Method: quicksort Memory: 25kB
9. 0.005 35.581 ↑ 43.3 3 3 / 3

Merge Join (cost=12,081.46..12,084.18 rows=130 width=34) (actual time=35.579..35.581 rows=3 loops=3)

  • Merge Cond: (ec.esc_combustivel = ta.tab_codigo)
10. 0.033 35.522 ↑ 94.0 3 3 / 3

Sort (cost=12,079.56..12,080.27 rows=282 width=21) (actual time=35.521..35.522 rows=3 loops=3)

  • Sort Key: ec.esc_combustivel
  • Sort Method: quicksort Memory: 25kB
11. 35.489 35.489 ↑ 94.0 3 3 / 3

Parallel Seq Scan on estoquecomb ec (cost=0.00..12,068.08 rows=282 width=21) (actual time=25.506..35.489 rows=3 loops=3)

  • Filter: ((esc_chave IS NOT NULL) AND (esc_qtde > '0'::numeric) AND (esc_data <= '2020-05-31 00:00:00'::timestamp without time zone) AND (cfg_chave = ANY ('{894,895,1123,1248,1361,1368,1417,1515,1525,1741,1777,1791,1908,1922,2363,2491,2492}'::bigint[])))
  • Rows Removed by Filter: 131464
12. 0.032 0.054 ↑ 1.5 2 3 / 3

Sort (cost=1.90..1.91 rows=3 width=13) (actual time=0.054..0.054 rows=2 loops=3)

  • Sort Key: ta.tab_codigo
  • Sort Method: quicksort Memory: 25kB
13. 0.022 0.022 ↑ 1.0 3 3 / 3

Seq Scan on tabauxiliar ta (cost=0.00..1.88 rows=3 width=13) (actual time=0.020..0.022 rows=3 loops=3)

  • Filter: (tab_tipo = 16)
  • Rows Removed by Filter: 67
14. 0.175 0.314 ↑ 1.8 420 3 / 3

Sort (cost=52.54..54.38 rows=738 width=27) (actual time=0.297..0.314 rows=420 loops=3)

  • Sort Key: r.res_chave
  • Sort Method: quicksort Memory: 81kB
15. 0.139 0.139 ↑ 1.0 738 3 / 3

Seq Scan on reservatorio r (cost=0.00..17.38 rows=738 width=27) (actual time=0.018..0.139 rows=738 loops=3)

Planning time : 2.511 ms