explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M6Gz

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 126.080 ↑ 423.0 4 1

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

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

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

  • Group Key: r.res_descricao, ta.tab_descricao
3. 41.689 125.891 ↑ 157.9 163 1

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

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

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

5. 0.000 47.087 ↑ 34.8 9 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
6. 10.102 47.155 ↑ 34.8 9 1

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

  • Workers Planned: 2
  • Workers Launched: 2
7. 0.029 37.053 ↑ 43.3 3 3 / 3

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

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

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

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

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

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

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

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

Parallel Seq Scan on estoquecomb ec (cost=0.00..12,068.08 rows=282 width=21) (actual time=27.883..36.606 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: 131,464
12. 0.042 0.066 ↑ 1.5 2 3 / 3

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

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

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

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

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

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

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