explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8t7T

Settings
# exclusive inclusive rows x rows loops node
1. 3.072 64,044.265 ↑ 1.0 100 1

Limit (cost=587,026.78..587,027.03 rows=100 width=168) (actual time=64,041.190..64,044.265 rows=100 loops=1)

2. 25.400 64,041.193 ↑ 642.3 100 1

Sort (cost=587,026.78..587,187.36 rows=64,230 width=168) (actual time=64,041.188..64,041.193 rows=100 loops=1)

  • Sort Key: gr.dt_cadastro DESC
  • Sort Method: top-N heapsort Memory: 56kB
3. 166.126 64,015.793 ↑ 1.0 61,533 1

GroupAggregate (cost=580,718.16..584,571.96 rows=64,230 width=168) (actual time=63,843.907..64,015.793 rows=61,533 loops=1)

  • Group Key: gr.id_gta_rascunho, g.nu_gta, g.nu_serie, g.ts_emissao, g.bo_ativo, es.no_especie, ll.loc_no, ll.ufe_sg, lld.loc_no, lld.ufe_sg
4. 91.705 63,849.667 ↑ 1.0 64,069 1

Sort (cost=580,718.16..580,878.73 rows=64,230 width=76) (actual time=63,843.847..63,849.667 rows=64,069 loops=1)

  • Sort Key: gr.id_gta_rascunho, g.nu_gta, g.nu_serie, g.ts_emissao, g.bo_ativo, es.no_especie, ll.loc_no, ll.ufe_sg, lld.loc_no, lld.ufe_sg
  • Sort Method: quicksort Memory: 10546kB
5. 427.446 63,757.962 ↑ 1.0 64,069 1

Hash Left Join (cost=120,042.20..575,589.08 rows=64,230 width=76) (actual time=1,623.321..63,757.962 rows=64,069 loops=1)

  • Hash Cond: (gr.id_caixa = c.id_caixa)
6. 110.163 62,278.343 ↑ 1.0 61,533 1

Hash Join (cost=30,128.49..459,717.59 rows=64,230 width=76) (actual time=568.150..62,278.343 rows=61,533 loops=1)

  • Hash Cond: (gr.id_documento_destino = dd.id)
7. 17.782 61,967.829 ↑ 1.0 61,533 1

Nested Loop (cost=16,458.46..442,751.96 rows=64,230 width=80) (actual time=363.975..61,967.829 rows=61,533 loops=1)

8. 0.089 0.089 ↑ 1.0 1 1

Index Scan using LOG_LOCALIDADE_pkey on log_localidade ll (cost=0.29..8.30 rows=1 width=17) (actual time=0.087..0.089 rows=1 loops=1)

  • Index Cond: (loc_nu = 2103)
9. 0.000 61,949.958 ↑ 1.0 61,533 1

Gather (cost=16,458.18..442,101.36 rows=64,230 width=69) (actual time=363.884..61,949.958 rows=61,533 loops=1)

  • Workers Planned: 2
  • Workers Launched: 1
10. 72.613 62,405.692 ↓ 1.1 30,766 2 / 2

Nested Loop Left Join (cost=15,458.18..434,678.36 rows=26,762 width=69) (actual time=368.354..62,405.692 rows=30,766 loops=2)

11. 28.811 55,595.216 ↓ 1.2 30,766 2 / 2

Hash Join (cost=15,457.74..231,645.25 rows=26,295 width=52) (actual time=367.861..55,595.216 rows=30,766 loops=2)

  • Hash Cond: (gr.id_municipio_destino = lld.loc_nu)
12. 120.172 55,560.215 ↓ 1.2 30,766 2 / 2

Hash Join (cost=15,093.27..231,211.72 rows=26,295 width=41) (actual time=361.347..55,560.215 rows=30,766 loops=2)

  • Hash Cond: (gr.id_documento_origem = d.id)
13. 68.824 55,267.037 ↓ 1.2 30,766 2 / 2

Hash Join (cost=1,423.24..215,513.67 rows=26,295 width=45) (actual time=181.211..55,267.037 rows=30,766 loops=2)

  • Hash Cond: (gr.id_especie = es.id)
14. 55,111.895 55,198.160 ↓ 1.2 30,766 2 / 2

Parallel Bitmap Heap Scan on gta_rascunho gr (cost=1,421.52..215,433.78 rows=26,295 width=45) (actual time=181.078..55,198.160 rows=30,766 loops=2)

  • Recheck Cond: (id_municipio_origem = 2103)
  • Heap Blocks: exact=23647
15. 86.265 86.265 ↑ 1.0 62,647 1 / 2

Bitmap Index Scan on gta_rascunho_id_municipio_origem_idx (cost=0.00..1,405.74 rows=63,108 width=0) (actual time=172.530..172.530 rows=62,647 loops=1)

  • Index Cond: (id_municipio_origem = 2103)
16. 0.017 0.053 ↑ 1.0 32 2 / 2

Hash (cost=1.32..1.32 rows=32 width=16) (actual time=0.053..0.053 rows=32 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
17. 0.036 0.036 ↑ 1.0 32 2 / 2

Seq Scan on especie es (cost=0.00..1.32 rows=32 width=16) (actual time=0.030..0.036 rows=32 loops=2)

18. 102.263 173.006 ↑ 1.0 382,060 2 / 2

Hash (cost=7,391.68..7,391.68 rows=382,668 width=4) (actual time=173.006..173.006 rows=382,060 loops=2)

  • Buckets: 524288 Batches: 2 Memory Usage: 10818kB
19. 70.743 70.743 ↑ 1.0 382,060 2 / 2

Seq Scan on documento d (cost=0.00..7,391.68 rows=382,668 width=4) (actual time=0.026..70.743 rows=382,060 loops=2)

20. 3.035 6.190 ↑ 1.0 10,021 2 / 2

Hash (cost=239.21..239.21 rows=10,021 width=17) (actual time=6.190..6.190 rows=10,021 loops=2)

  • Buckets: 16384 Batches: 1 Memory Usage: 622kB
21. 3.155 3.155 ↑ 1.0 10,021 2 / 2

Seq Scan on log_localidade lld (cost=0.00..239.21 rows=10,021 width=17) (actual time=0.027..3.155 rows=10,021 loops=2)

22. 6,737.864 6,737.864 ↑ 1.0 1 61,533 / 2

Index Scan using gta_id_gta_rascunho_idx on gta g (cost=0.43..7.71 rows=1 width=21) (actual time=0.219..0.219 rows=1 loops=61,533)

  • Index Cond: (id_gta_rascunho = gr.id_gta_rascunho)
23. 117.993 200.351 ↑ 1.0 382,060 1

Hash (cost=7,391.68..7,391.68 rows=382,668 width=4) (actual time=200.351..200.351 rows=382,060 loops=1)

  • Buckets: 524288 Batches: 2 Memory Usage: 10819kB
24. 82.358 82.358 ↑ 1.0 382,060 1

Seq Scan on documento dd (cost=0.00..7,391.68 rows=382,668 width=4) (actual time=0.026..82.358 rows=382,060 loops=1)

25. 564.879 1,052.173 ↓ 1.0 2,628,257 1

Hash (cost=47,135.09..47,135.09 rows=2,607,409 width=8) (actual time=1,052.172..1,052.173 rows=2,628,257 loops=1)

  • Buckets: 524288 Batches: 16 Memory Usage: 10502kB
26. 487.294 487.294 ↓ 1.0 2,628,257 1

Seq Scan on credito c (cost=0.00..47,135.09 rows=2,607,409 width=8) (actual time=0.022..487.294 rows=2,628,257 loops=1)