explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uiPDg

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=1,825,285.11..1,830,691.96 rows=127,220 width=552) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=1,825,285.11..1,825,603.16 rows=127,220 width=552) (actual rows= loops=)

  • Sort Key: bt.num_a, bt.competencia, bb.id_contrato, r.id_contrato, ((SubPlan 1)), ((SubPlan 2)), b.num_contrato, a.num_contrato, aa.id, aa.id_categoria, aa.status, aa.id_lote_linha, bb.id, bb.dat_ativacao, bb.dat_desativacao, bb.imei
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=211,786.58..1,783,187.78 rows=127,220 width=552) (actual rows= loops=)

  • Hash Cond: ((bt.num_a)::text = (aa.num_linha_telefone)::text)
  • Join Filter: (r.id_contrato <> bb.id_contrato)
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=41,513.58..643,392.59 rows=186,377 width=39) (actual rows= loops=)

  • Hash Cond: (bt.id_arquivo_entrada = ag.id_arquivo_entrada)
5. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_totalizador_cdr bt (cost=27,174.41..621,833.21 rows=1,428,384 width=23) (actual rows= loops=)

  • Recheck Cond: (competencia >= 201906)
6. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on totcdr_comp_idx (cost=0.00..26,817.32 rows=1,428,384 width=0) (actual rows= loops=)

  • Index Cond: (competencia >= 201906)
7. 0.000 0.000 ↓ 0.0

Hash (cost=12,966.63..12,966.63 rows=109,803 width=28) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=7.41..12,966.63 rows=109,803 width=28) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash Join (cost=6.98..33.50 rows=611 width=32) (actual rows= loops=)

  • Hash Cond: (ga.id_remessa = r.id)
10. 0.000 0.000 ↓ 0.0

Seq Scan on tb_grupo_arquivo ga (cost=0.00..18.11 rows=611 width=12) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash (cost=6.51..6.51 rows=38 width=28) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.85..6.51 rows=38 width=28) (actual rows= loops=)

  • Hash Cond: (a.id = r.id_contrato)
13. 0.000 0.000 ↓ 0.0

Seq Scan on tb_contrato a (cost=0.00..3.85 rows=85 width=20) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=1.38..1.38 rows=38 width=12) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on tb_remessa r (cost=0.00..1.38 rows=38 width=12) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Scan using arqgp_idgp_idx on ta_arquivo_grupo ag (cost=0.42..20.78 rows=39 width=12) (actual rows= loops=)

  • Index Cond: ((id_grupo_arquivo = ga.id) AND (versao = ga.versao))
17. 0.000 0.000 ↓ 0.0

Hash (cost=170,103.99..170,103.99 rows=13,521 width=77) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash Join (cost=5.20..170,103.99 rows=13,521 width=77) (actual rows= loops=)

  • Hash Cond: (bb.id_contrato = b.id)
19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..169,929.79 rows=13,521 width=61) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on tb_linha_telefone aa (cost=0.00..338.87 rows=19,287 width=25) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using lintelhist_idlintel_idx on tb_linha_telefone_hist bb (cost=0.29..8.78 rows=1 width=40) (actual rows= loops=)

  • Index Cond: (id_linha_telefone = aa.id)
  • Filter: (SubPlan 3)
22.          

SubPlan (for Index Scan)

23. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.31..8.32 rows=1 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Index Scan using lintelhist_idlintel_idx on tb_linha_telefone_hist xx (cost=0.29..8.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id_linha_telefone = aa.id)
25. 0.000 0.000 ↓ 0.0

Hash (cost=3.85..3.85 rows=85 width=20) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Seq Scan on tb_contrato b (cost=0.00..3.85 rows=85 width=20) (actual rows= loops=)

27.          

SubPlan (for Hash Join)

28. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..6.05 rows=1 width=20) (actual rows= loops=)

  • Join Filter: (e.id = c.id_entidade)
29. 0.000 0.000 ↓ 0.0

Seq Scan on tb_contrato c (cost=0.00..4.06 rows=1 width=4) (actual rows= loops=)

  • Filter: (id = bb.id_contrato)
30. 0.000 0.000 ↓ 0.0

Seq Scan on tb_entidade e (cost=0.00..1.44 rows=44 width=24) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Seq Scan on tb_entidade e_1 (cost=0.00..1.55 rows=1 width=20) (actual rows= loops=)

  • Filter: (r.id_entidade = id)