explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fgej

Settings
# exclusive inclusive rows x rows loops node
1. 0.016 115.660 ↑ 423.0 4 1

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

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

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

  • Group Key: r.res_descricao, ta.tab_descricao
3. 37.441 115.514 ↑ 157.9 163 1

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

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

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

5. 0.000 43.299 ↑ 34.8 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 9.617 43.373 ↑ 34.8 9 1

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

  • Workers Planned: 2
  • Workers Launched: 2
7. 0.022 33.756 ↑ 43.3 3 3 / 3

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

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

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

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

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

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

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

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

Parallel Seq Scan on estoquecomb ec (cost=0.00..12,068.08 rows=282 width=21) (actual time=26.615..33.454 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.017 0.031 ↑ 1.5 2 2 / 3

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

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

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

  • Filter: (tab_tipo = 16)
  • Rows Removed by Filter: 67
14. 0.109 0.201 ↑ 1.6 460 2 / 3

Sort (cost=52.54..54.38 rows=738 width=27) (actual time=0.284..0.301 rows=460 loops=2)

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

Seq Scan on reservatorio r (cost=0.00..17.38 rows=738 width=27) (actual time=0.012..0.137 rows=738 loops=2)

Planning time : 2.700 ms