explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TtXR

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

Sort (cost=20,567.05..20,567.06 rows=1 width=84) (actual rows= loops=)

  • Sort Key: d.num_cpf, d.tipo_bloco, d.num_mes_pgto, (CASE WHEN ((d.tipo_linha)::text = 'RTRT'::text) THEN 2 WHEN ((d.tipo_linha)::text = 'RTIRF'::text) THEN 3 WHEN ((d.tipo_linha)::text = 'RTPO'::text) THEN 6 WHEN ((d.tipo_linha)::text = 'RTPP'::text) THE (...)
2. 0.000 0.000 ↓ 0.0

WindowAgg (cost=20,566.97..20,567.04 rows=1 width=84) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=20,566.97..20,566.98 rows=1 width=84) (actual rows= loops=)

  • Sort Key: d.num_cpf, d.num_mes_pgto
4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=20,566.87..20,566.96 rows=1 width=84) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=20,566.87..20,566.87 rows=1 width=84) (actual rows= loops=)

  • Sort Key: d.num_cpf, d.tipo_bloco, d.num_mes_pgto, (CASE WHEN ((d.tipo_linha)::text = 'RTRT'::text) THEN 2 WHEN ((d.tipo_linha)::text = 'RTIRF'::text) THEN 3 WHEN ((d.tipo_linha)::text = 'RTPO'::text) THEN 6 WHEN ((d.tipo_linha):: (...)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,695.76..20,566.86 rows=1 width=84) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,924.45..1,924.48 rows=3 width=16) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d1 (cost=1,648.78..1,924.33 rows=25 width=16) (actual rows= loops=)

  • Recheck Cond: ((num_ano_pgto = 2019) AND (isn_orgao_envio = 37))
  • Filter: ((vlr_enviado > 0) AND ((tipo_linha)::text = ANY ('{RTRT,RIMOG,RIBMR,RTIRF,RIP65,RTPA_DEP}'::text[])))
9. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=1,648.78..1,648.78 rows=69 width=0) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_anomes (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_orgao_env (cost=0.00..894.74 rows=48,307 width=0) (actual rows= loops=)

  • Index Cond: (isn_orgao_envio = 37)
12. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d (cost=771.30..6,214.11 rows=1 width=84) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d1.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((vlr_enviado > 0) AND ((tipo_linha)::text <> 'LINHA'::text) AND ((tipo_bloco)::text <> 'BLOCO'::text) AND ((tipo_bloco)::text <> '1889'::text) AND (isn_orgao_envio = 37) AND (NOT (SubPlan 1)) AND ((SubPlan 2) (...)
13. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d1.num_cpf)::text)
15. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_anomes (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
16.          

SubPlan (for Bitmap Heap Scan)

17. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=786.63..786.67 rows=1 width=12) (actual rows= loops=)

  • Filter: (count(*) > 1)
18. 0.000 0.000 ↓ 0.0

HashAggregate (cost=786.63..786.64 rows=1 width=23) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=771.86..786.63 rows=1 width=23) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=771.58..783.63 rows=1 width=35) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d2 (cost=771.30..775.32 rows=1 width=25) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((dat_nascimento IS NOT NULL) AND (isn_orgao_envio = d.isn_orgao_envio))
22. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d.num_cpf)::text)
24. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_anomes (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
25. 0.000 0.000 ↓ 0.0

Index Scan using co_pk_servidor on tb_servidor_congelado s (cost=0.28..8.30 rows=1 width=10) (actual rows= loops=)

  • Index Cond: ((isn_servidor = d2.isn_servidor) AND (num_ano = 2019))
26. 0.000 0.000 ↓ 0.0

Index Scan using idx_co_fk_servidor_tb_vinculo_congelado on tb_vinculo_congelado v (cost=0.28..2.99 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (isn_servidor = s.isn_servidor)
  • Filter: ((cod_situacao_funcional <> 7) AND (num_ano = 2019))
27. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=771.30..775.36 rows=1 width=24) (actual rows= loops=)

  • Filter: (sum(d1_1.vlr_enviado) > 600000::numeric)
28. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d1_1 (cost=771.30..775.34 rows=1 width=24) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((isn_orgao_envio = d.isn_orgao_envio) AND ((tipo_linha)::text = 'RTRT'::text) AND (num_mes_pgto = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12}'::integer[])))
29. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d.num_cpf)::text)
31. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_ano (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
32. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=771.30..775.36 rows=1 width=24) (actual rows= loops=)

  • Filter: (sum(d1_2.vlr_enviado) > 600000::numeric)
33. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d1_2 (cost=771.30..775.34 rows=1 width=24) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((isn_orgao_envio = d.isn_orgao_envio) AND ((tipo_linha)::text = 'RIMOG'::text) AND (num_mes_pgto = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12}'::integer[])))
34. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d.num_cpf)::text)
36. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_ano (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
37. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=771.30..775.36 rows=1 width=24) (actual rows= loops=)

  • Filter: (sum(d1_3.vlr_enviado) > 600000::numeric)
38. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d1_3 (cost=771.30..775.34 rows=1 width=24) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((isn_orgao_envio = d.isn_orgao_envio) AND ((tipo_linha)::text = 'RIBMR'::text) AND (num_mes_pgto = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12}'::integer[])))
39. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d.num_cpf)::text)
41. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_ano (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
42. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=771.30..775.36 rows=1 width=24) (actual rows= loops=)

  • Filter: (sum(d1_4.vlr_enviado) > 600000::numeric)
43. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d1_4 (cost=771.30..775.34 rows=1 width=24) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((isn_orgao_envio = d.isn_orgao_envio) AND ((tipo_linha)::text = 'RIP65'::text) AND (num_mes_pgto = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12}'::integer[])))
44. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d.num_cpf)::text)
46. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_ano (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
47. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=771.30..775.34 rows=1 width=24) (actual rows= loops=)

  • Filter: (sum(d1_5.vlr_enviado) > 0::numeric)
48. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d1_5 (cost=771.30..775.32 rows=1 width=24) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((isn_orgao_envio = d.isn_orgao_envio) AND ((tipo_linha)::text = 'RTIRF'::text))
49. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d.num_cpf)::text)
51. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_anomes (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)
52. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=771.30..775.34 rows=1 width=24) (actual rows= loops=)

  • Filter: (sum(d1_6.vlr_enviado) > 0::numeric)
53. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_carga_dirf d1_6 (cost=771.30..775.32 rows=1 width=24) (actual rows= loops=)

  • Recheck Cond: (((num_cpf)::text = (d.num_cpf)::text) AND (num_ano_pgto = 2019))
  • Filter: ((isn_orgao_envio = d.isn_orgao_envio) AND ((tipo_linha)::text = 'RTPA_DEP'::text))
54. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=771.30..771.30 rows=1 width=0) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cpf (cost=0.00..17.27 rows=628 width=0) (actual rows= loops=)

  • Index Cond: ((num_cpf)::text = (d.num_cpf)::text)
56. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_anomes (cost=0.00..753.78 rows=40,712 width=0) (actual rows= loops=)

  • Index Cond: (num_ano_pgto = 2019)