explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OrbXb

Settings
# exclusive inclusive rows x rows loops node
1. 1,466.156 7,528.226 ↓ 7.3 292,113 1

Hash Join (cost=1,343.05..11,116,840.87 rows=40,233 width=476) (actual time=14.869..7,528.226 rows=292,113 loops=1)

  • Hash Cond: (nfs.id_empresa = sis_empresa.id_empresa)
2. 88.361 511.162 ↓ 7.3 292,113 1

Hash Join (cost=1,339.90..26,940.73 rows=40,233 width=96) (actual time=12.926..511.162 rows=292,113 loops=1)

  • Hash Cond: (nfs.id_cliente = p.id_pessoa)
3. 109.766 410.558 ↓ 7.3 292,113 1

Hash Join (cost=37.59..25,532.79 rows=40,233 width=96) (actual time=0.600..410.558 rows=292,113 loops=1)

  • Hash Cond: (nfs.id_modelo_documento_fiscal = mdf.id_modelo_documento_fiscal)
4. 300.231 300.231 ↓ 1.1 293,816 1

Index Scan using idx_nota_fiscal_saida_emissao on nota_fiscal_saida nfs (cost=0.43..24,761.02 rows=278,736 width=91) (actual time=0.028..300.231 rows=293,816 loops=1)

  • Index Cond: ((emissao >= '2018-10-01'::date) AND (emissao <= '2018-10-31'::date))
  • Filter: ((situacao = 1) AND (COALESCE(btrim((chave_acesso_nfe)::text), ''::text) <> ''::text))
  • Rows Removed by Filter: 16931
5. 0.072 0.561 ↑ 1.0 153 1

Hash (cost=35.25..35.25 rows=153 width=9) (actual time=0.561..0.561 rows=153 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
6. 0.489 0.489 ↑ 1.0 153 1

Seq Scan on modelo_documento_fiscal mdf (cost=0.00..35.25 rows=153 width=9) (actual time=0.026..0.489 rows=153 loops=1)

  • Filter: (codigo_modelo_documento = '65'::bpchar)
  • Rows Removed by Filter: 907
7. 4.986 12.243 ↑ 1.0 24,369 1

Hash (cost=997.69..997.69 rows=24,369 width=4) (actual time=12.243..12.243 rows=24,369 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1113kB
8. 7.257 7.257 ↑ 1.0 24,369 1

Seq Scan on pessoa p (cost=0.00..997.69 rows=24,369 width=4) (actual time=0.010..7.257 rows=24,369 loops=1)

9. 0.023 0.057 ↑ 1.0 51 1

Hash (cost=2.51..2.51 rows=51 width=4) (actual time=0.057..0.057 rows=51 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
10. 0.034 0.034 ↑ 1.0 51 1

Seq Scan on sis_empresa (cost=0.00..2.51 rows=51 width=4) (actual time=0.012..0.034 rows=51 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..98.29 rows=1 width=0) (never executed)

  • Filter: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
14. 0.704 0.704 ↑ 1.0 4,903 1

Seq Scan on parcela_nfs pnfs_1 (cost=0.00..86.03 rows=4,903 width=4) (actual time=0.018..0.704 rows=4,903 loops=1)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on parcela_nfs pnfs_2 (cost=0.00..110.55 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..86.03 rows=4,903 width=8) (never executed)

17. 584.226 1,168.452 ↑ 1.0 1 292,113

Aggregate (cost=11.12..11.13 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=292,113)

18. 584.226 584.226 ↑ 42.0 2 292,113

Index Scan using idx_1101_01 on item_nfs (cost=0.43..10.91 rows=84 width=3) (actual time=0.002..0.002 rows=2 loops=292,113)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
19. 292.113 876.339 ↑ 1.0 1 292,113

Aggregate (cost=11.12..11.13 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=292,113)

20. 584.226 584.226 ↑ 42.0 2 292,113

Index Scan using idx_1101_01 on item_nfs item_nfs_1 (cost=0.43..10.91 rows=84 width=3) (actual time=0.002..0.002 rows=2 loops=292,113)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
21. 292.113 876.339 ↑ 1.0 1 292,113

Aggregate (cost=11.12..11.13 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=292,113)

22. 584.226 584.226 ↑ 42.0 2 292,113

Index Scan using idx_1101_01 on item_nfs item_nfs_2 (cost=0.43..10.91 rows=84 width=3) (actual time=0.002..0.002 rows=2 loops=292,113)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
23. 292.113 876.339 ↑ 1.0 1 292,113

Aggregate (cost=11.12..11.13 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=292,113)

24. 584.226 584.226 ↑ 42.0 2 292,113

Index Scan using idx_1101_01 on item_nfs item_nfs_3 (cost=0.43..10.91 rows=84 width=3) (actual time=0.002..0.002 rows=2 loops=292,113)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
25. 292.113 876.339 ↑ 1.0 1 292,113

Aggregate (cost=11.12..11.13 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=292,113)

26. 584.226 584.226 ↑ 42.0 2 292,113

Index Scan using idx_1101_01 on item_nfs item_nfs_4 (cost=0.43..10.91 rows=84 width=3) (actual time=0.002..0.002 rows=2 loops=292,113)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
27. 292.113 876.339 ↑ 1.0 1 292,113

Aggregate (cost=11.12..11.13 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=292,113)

28. 584.226 584.226 ↑ 42.0 2 292,113

Index Scan using idx_1101_01 on item_nfs item_nfs_5 (cost=0.43..10.91 rows=84 width=3) (actual time=0.002..0.002 rows=2 loops=292,113)

  • Index Cond: (id_nota_fiscal_saida = nfs.id_nota_fiscal_saida)
Planning time : 5.784 ms
Execution time : 7,552.159 ms