explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hqvb

Settings
# exclusive inclusive rows x rows loops node
1. 0.914 23.729 ↑ 2.0 1,360 1

Unique (cost=3,258.40..3,804.00 rows=2,728 width=811) (actual time=22.491..23.729 rows=1,360 loops=1)

2. 3.630 22.815 ↑ 2.0 1,360 1

Sort (cost=3,258.40..3,265.22 rows=2,728 width=811) (actual time=22.487..22.815 rows=1,360 loops=1)

  • Sort Key: vw_produtos_lncc.num_ano, vw_produtos_lncc.num_ano_relatorio, vw_produtos_lncc.date_part, vw_produtos_lncc.date_fim, vw_produtos_lncc.dat_inicio, vw_produtos_lncc.dat_fim, vw_produtos_lncc.idt_produto, vw_produtos_lncc.des_tipo_producao, (...)
  • Sort Method: external merge Disk: 1056kB
3. 0.613 19.185 ↑ 2.0 1,360 1

Subquery Scan on vw_produtos_lncc (cost=2,088.62..2,122.72 rows=2,728 width=811) (actual time=18.141..19.185 rows=1,360 loops=1)

4. 12.755 18.572 ↑ 2.0 1,360 1

Sort (cost=2,088.62..2,095.44 rows=2,728 width=803) (actual time=18.137..18.572 rows=1,360 loops=1)

  • Sort Key: produtos_lncc.idt_tipo_orientacao, produtos_lncc.num_ano_relatorio, produtos_lncc.sts_artigo, tipos_producao.num_ordem, tipos_producao_cientifica.num_ordem, produtos_lncc.des_titulo
  • Sort Method: external sort Disk: 1080kB
5. 0.702 5.817 ↑ 2.0 1,360 1

Nested Loop (cost=1.20..959.94 rows=2,728 width=803) (actual time=0.056..5.817 rows=1,360 loops=1)

6. 0.536 5.115 ↑ 1.0 1,360 1

Hash Left Join (cost=1.20..895.81 rows=1,364 width=742) (actual time=0.032..5.115 rows=1,360 loops=1)

  • Hash Cond: (produtos_lncc.idt_tipo_orientacao = tipos_orientacao.idt_orientacao)
7. 4.574 4.574 ↑ 1.0 1,360 1

Seq Scan on produtos_lncc (cost=0.00..888.61 rows=1,364 width=712) (actual time=0.016..4.574 rows=1,360 loops=1)

  • Filter: ((NOT sts_deletado) AND (NOT sts_deletado) AND (idt_tipo_prod_cientifica = 1) AND (idt_tipo_producao = 1))
  • Rows Removed by Filter: 10622
8. 0.003 0.005 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=34) (actual time=0.005..0.005 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
9. 0.002 0.002 ↑ 1.0 9 1

Seq Scan on tipos_orientacao (cost=0.00..1.09 rows=9 width=34) (actual time=0.001..0.002 rows=9 loops=1)

10. 0.000 0.000 ↑ 2.0 1 1,360

Materialize (cost=0.00..2.75 rows=2 width=73) (actual time=0.000..0.000 rows=1 loops=1,360)

11. 0.003 0.015 ↑ 2.0 1 1

Nested Loop (cost=0.00..2.74 rows=2 width=73) (actual time=0.013..0.015 rows=1 loops=1)

12. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on tipos_producao (cost=0.00..1.14 rows=1 width=31) (actual time=0.005..0.005 rows=1 loops=1)

  • Filter: (idt_tipo_producao = 1)
  • Rows Removed by Filter: 10
13. 0.007 0.007 ↑ 2.0 1 1

Seq Scan on tipos_producao_cientifica (cost=0.00..1.58 rows=2 width=42) (actual time=0.006..0.007 rows=1 loops=1)

  • Filter: ((idt_tipo_prod_cientifica = 1) AND (idt_tipo_producao = 1))
  • Rows Removed by Filter: 38