explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rWo5

Settings
# exclusive inclusive rows x rows loops node
1. 1,755.474 7,665.720 ↓ 7.4 159,684 1

Hash Join (cost=291.44..1,165,898.71 rows=21,472 width=480) (actual time=11.589..7,665.720 rows=159,684 loops=1)

  • Hash Cond: (nfs.id_empresa = sis_empresa.id_empresa)
2. 88.979 800.248 ↓ 7.4 159,684 1

Hash Join (cost=290.40..12,644.06 rows=21,472 width=96) (actual time=10.614..800.248 rows=159,684 loops=1)

  • Hash Cond: (nfs.id_cliente = p.id_pessoa)
3. 96.201 701.114 ↓ 7.4 159,684 1

Hash Join (cost=2.97..12,300.21 rows=21,472 width=96) (actual time=0.392..701.114 rows=159,684 loops=1)

  • Hash Cond: (nfs.id_modelo_documento_fiscal = mdf.id_modelo_documento_fiscal)
4. 604.839 604.839 ↓ 1.0 165,609 1

Seq Scan on nota_fiscal_saida nfs (cost=0.00..11,838.57 rows=164,617 width=91) (actual time=0.292..604.839 rows=165,609 loops=1)

  • Filter: ((emissao >= '2016-01-01'::date) AND (emissao <= '2019-03-31'::date) AND (situacao = 1) AND (COALESCE(btrim((chave_acesso_nfe)::text), ''::text) <> ''::text))
  • Rows Removed by Filter: 14361
5. 0.017 0.074 ↑ 1.0 9 1

Hash (cost=2.86..2.86 rows=9 width=9) (actual time=0.074..0.074 rows=9 loops=1)

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

Seq Scan on modelo_documento_fiscal mdf (cost=0.00..2.86 rows=9 width=9) (actual time=0.033..0.057 rows=9 loops=1)

  • Filter: (codigo_modelo_documento = '65'::bpchar)
  • Rows Removed by Filter: 60
7. 1.696 10.155 ↑ 1.0 4,730 1

Hash (cost=228.30..228.30 rows=4,730 width=4) (actual time=10.155..10.155 rows=4,730 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 231kB
8. 8.459 8.459 ↑ 1.0 4,730 1

Seq Scan on pessoa p (cost=0.00..228.30 rows=4,730 width=4) (actual time=0.021..8.459 rows=4,730 loops=1)

9. 0.019 0.058 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=4) (actual time=0.058..0.058 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.039 0.039 ↑ 1.0 2 1

Seq Scan on sis_empresa (cost=0.00..1.02 rows=2 width=4) (actual time=0.038..0.039 rows=2 loops=1)

11.          

SubPlan (forHash Join)

12. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=4) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Seq Scan on parcela_nfs pnfs (cost=0.00..1.26 rows=1 width=0) (never executed)

  • Filter: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
14. 0.052 0.052 ↑ 1.0 21 1

Seq Scan on parcela_nfs pnfs_1 (cost=0.00..1.21 rows=21 width=4) (actual time=0.046..0.052 rows=21 loops=1)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on parcela_nfs pnfs_2 (cost=0.00..1.31 rows=1 width=0) (never executed)

  • Filter: ((id_nota_fiscal_saida = nfs.id_nota_fiscal_saida) AND (vencimento = nfs.emissao))
16. 0.000 0.000 ↓ 0.0 0

Seq Scan on parcela_nfs pnfs_3 (cost=0.00..1.21 rows=21 width=8) (never executed)

17. 319.368 1,117.788 ↑ 1.0 1 159,684

Aggregate (cost=8.51..8.52 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=159,684)

18. 798.420 798.420 ↑ 2.0 2 159,684

Index Scan using idx_1101_01 on item_nfs (cost=0.42..8.49 rows=4 width=3) (actual time=0.004..0.005 rows=2 loops=159,684)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
19. 319.368 798.420 ↑ 1.0 1 159,684

Aggregate (cost=8.51..8.52 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=159,684)

20. 479.052 479.052 ↑ 2.0 2 159,684

Index Scan using idx_1101_01 on item_nfs item_nfs_1 (cost=0.42..8.49 rows=4 width=3) (actual time=0.003..0.003 rows=2 loops=159,684)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
21. 319.368 798.420 ↑ 1.0 1 159,684

Aggregate (cost=8.51..8.52 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=159,684)

22. 479.052 479.052 ↑ 2.0 2 159,684

Index Scan using idx_1101_01 on item_nfs item_nfs_2 (cost=0.42..8.49 rows=4 width=3) (actual time=0.003..0.003 rows=2 loops=159,684)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
23. 319.368 798.420 ↑ 1.0 1 159,684

Aggregate (cost=8.51..8.52 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=159,684)

24. 479.052 479.052 ↑ 2.0 2 159,684

Index Scan using idx_1101_01 on item_nfs item_nfs_3 (cost=0.42..8.49 rows=4 width=3) (actual time=0.003..0.003 rows=2 loops=159,684)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
25. 319.368 798.420 ↑ 1.0 1 159,684

Aggregate (cost=8.51..8.52 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=159,684)

26. 479.052 479.052 ↑ 2.0 2 159,684

Index Scan using idx_1101_01 on item_nfs item_nfs_4 (cost=0.42..8.49 rows=4 width=3) (actual time=0.003..0.003 rows=2 loops=159,684)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
27. 319.368 798.420 ↑ 1.0 1 159,684

Aggregate (cost=8.51..8.52 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=159,684)

28. 479.052 479.052 ↑ 2.0 2 159,684

Index Scan using idx_1101_01 on item_nfs item_nfs_5 (cost=0.42..8.49 rows=4 width=3) (actual time=0.003..0.003 rows=2 loops=159,684)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)