explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rkALa

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

GroupAggregate (cost=4,939.03..4,939.08 rows=1 width=234) (actual rows= loops=)

  • Group Key: t0_.id_pessoa, t0_.no_pessoa, t0_.no_sobrenome, ch.no_cargo, ch.no_funcao, t2_.no_situacao_cadastro, t3_.sg_pais, t3_.no_pais, t4_.id_tipo_carteira, kk1.dt_alteracao, t7_.no_registro
2. 0.000 0.000 ↓ 0.0

Sort (cost=4,939.03..4,939.04 rows=1 width=234) (actual rows= loops=)

  • Sort Key: t0_.id_pessoa, t0_.no_pessoa, t0_.no_sobrenome, ch.no_cargo, ch.no_funcao, t2_.no_situacao_cadastro, t3_.sg_pais, t3_.no_pais, t4_.id_tipo_carteira, kk1.dt_alteracao, t7_.no_registro
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4,419.77..4,939.02 rows=1 width=234) (actual rows= loops=)

  • Join Filter: (t0_.id_pessoa = t8_.id_pessoa)
4. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=1,441.19..1,833.95 rows=1 width=224) (actual rows= loops=)

  • Hash Cond: (t5_.id_titular = t0_.id_pessoa)
  • Filter: (((t0_.no_registro_ascii)::text = '34.543-x'::text) OR ((t5_.no_registro_ascii)::text = '34.543-x'::text) OR ((((t0_.no_pessoa_ascii)::text || ' '::text) || (t0_.no_sobrenome_ascii)::text) = 'lcdi'::text) OR ((((t5_.no_pessoa_as (...)
5. 0.000 0.000 ↓ 0.0

Seq Scan on tb_pessoa t5_ (cost=0.00..374.43 rows=4,739 width=39) (actual rows= loops=)

  • Filter: in_ativo
6. 0.000 0.000 ↓ 0.0

Hash (cost=1,440.95..1,440.95 rows=19 width=251) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,307.18..1,440.95 rows=19 width=251) (actual rows= loops=)

  • Hash Cond: (t0_.id_pessoa = kk1.id_pessoa)
8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=255.42..389.10 rows=19 width=243) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=255.27..385.37 rows=19 width=233) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash Join (cost=255.00..379.16 rows=19 width=233) (actual rows= loops=)

  • Hash Cond: (t0_.id_situacao_cadastro = t2_.id_situacao_cadastro)
  • Join Filter: ((t2_.id_situacao_cadastro <> ALL ('{1,2,4,5,6}'::integer[])) OR ((t2_.id_situacao_cadastro = ANY ('{2,4,5,6}'::integer[])) AND (hashed SubPlan 1)))
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=252.60..376.13 rows=31 width=119) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=252.32..321.41 rows=62 width=52) (actual rows= loops=)

  • Hash Cond: ((tb_chegada.id_pessoa = ch.id_pessoa) AND ((max(tb_chegada.dt_chegada)) = ch.dt_chegada))
13. 0.000 0.000 ↓ 0.0

HashAggregate (cost=80.94..106.06 rows=2,512 width=8) (actual rows= loops=)

  • Group Key: tb_chegada.id_pessoa
14. 0.000 0.000 ↓ 0.0

Seq Scan on tb_chegada (cost=0.00..68.29 rows=2,529 width=8) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=167.65..167.65 rows=249 width=52) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash Join (cost=87.48..167.65 rows=249 width=52) (actual rows= loops=)

  • Hash Cond: (ch.id_chegada = t10_.id_chegada)
17. 0.000 0.000 ↓ 0.0

Seq Scan on tb_chegada ch (cost=0.00..68.29 rows=2,505 width=52) (actual rows= loops=)

  • Filter: in_ativo
18. 0.000 0.000 ↓ 0.0

Hash (cost=84.34..84.34 rows=251 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.06..84.34 rows=251 width=8) (actual rows= loops=)

  • Hash Cond: (t10_.id_categoria_funcional = t13_.id_categoria_funcional)
20. 0.000 0.000 ↓ 0.0

Seq Scan on tb_chegada t10_ (cost=0.00..68.29 rows=2,529 width=12) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=4.02..4.02 rows=3 width=12) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Hash Join (cost=2.58..4.02 rows=3 width=12) (actual rows= loops=)

  • Hash Cond: (t12_.id_categoria_funcional = t13_.id_categoria_funcional)
23. 0.000 0.000 ↓ 0.0

Seq Scan on tb_categoria_funcional t12_ (cost=0.00..1.30 rows=30 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash (cost=2.54..2.54 rows=3 width=8) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.10..2.54 rows=3 width=8) (actual rows= loops=)

  • Hash Cond: (t13_.id_tipo_carteira = t4_.id_tipo_carteira)
26. 0.000 0.000 ↓ 0.0

Seq Scan on tb_tipo_carteira_categoria t13_ (cost=0.00..1.30 rows=30 width=8) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Hash (cost=1.06..1.06 rows=3 width=4) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Seq Scan on tb_tipo_carteira t4_ (cost=0.00..1.06 rows=3 width=4) (actual rows= loops=)

  • Filter: in_ativo
29. 0.000 0.000 ↓ 0.0

Index Scan using pk_tb_pessoa on tb_pessoa t0_ (cost=0.28..0.87 rows=1 width=75) (actual rows= loops=)

  • Index Cond: (id_pessoa = ch.id_pessoa)
  • Filter: (in_ativo AND (id_titular IS NULL))
30. 0.000 0.000 ↓ 0.0

Hash (cost=1.21..1.21 rows=7 width=122) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Seq Scan on tb_situacao_cadastro t2_ (cost=0.00..1.21 rows=7 width=122) (actual rows= loops=)

  • Filter: ((id_situacao_cadastro <> ALL ('{1,2,4,5,6}'::integer[])) OR (id_situacao_cadastro = ANY ('{2,4,5,6}'::integer[])))
32.          

SubPlan (for Hash Join)

33. 0.000 0.000 ↓ 0.0

Seq Scan on tb_unidade_administrativa_tipo_solicitacao t14_ (cost=0.00..1.09 rows=1 width=4) (actual rows= loops=)

  • Filter: ((id_unidade_administrativa = 71) AND (id_tipo_solicitacao = 1))
34. 0.000 0.000 ↓ 0.0

Index Scan using pk_tb_organizacao on tb_organizacao t9_ (cost=0.28..0.32 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_organizacao = t0_.id_organizacao)
35. 0.000 0.000 ↓ 0.0

Index Scan using idx_id_pais on tb_pais t3_ (cost=0.14..0.19 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (id_pais = t9_.id_pais)
36. 0.000 0.000 ↓ 0.0

Hash (cost=1,051.75..1,051.75 rows=1 width=12) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Subquery Scan on kk1 (cost=1,051.73..1,051.75 rows=1 width=12) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Unique (cost=1,051.73..1,051.74 rows=1 width=12) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Sort (cost=1,051.73..1,051.74 rows=1 width=12) (actual rows= loops=)

  • Sort Key: t6_.id_pessoa, t6_.dt_alteracao
40. 0.000 0.000 ↓ 0.0

Seq Scan on tb_historico_situacao_cadastro t6_ (cost=0.00..1,051.72 rows=1 width=12) (actual rows= loops=)

  • Filter: (id_situacao_cadastro = 7)
41. 0.000 0.000 ↓ 0.0

Unique (cost=2,978.59..3,002.52 rows=4,558 width=22) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Sort (cost=2,978.59..2,990.55 rows=4,786 width=22) (actual rows= loops=)

  • Sort Key: t8_.id_pessoa, t7_.dt_expedicao
43. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=380.70..2,686.05 rows=4,786 width=22) (actual rows= loops=)

  • Hash Cond: (t7_.id_solicitacao = t8_.id_solicitacao)
44. 0.000 0.000 ↓ 0.0

Seq Scan on tb_solicitacao_recibo t7_ (cost=0.00..2,215.78 rows=4,778 width=34) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Hash (cost=320.88..320.88 rows=4,786 width=20) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Seq Scan on tb_solicitacao t8_ (cost=0.00..320.88 rows=4,786 width=20) (actual rows= loops=)

  • Filter: in_ativo