explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yVxa

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

GroupAggregate (cost=61,121.19..61,121.24 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, t6_.dt_alteracao, t7_.no_registro
2. 0.000 0.000 ↓ 0.0

Sort (cost=61,121.19..61,121.20 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, t6_.dt_alteracao, t7_.no_registro
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4,571.01..61,121.18 rows=1 width=234) (actual rows= loops=)

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

Nested Loop Left Join (cost=1,592.42..58,016.11 rows=1 width=224) (actual rows= loops=)

  • Join Filter: (t6_.id_pessoa = t0_.id_pessoa)
5. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=540.68..56,964.34 rows=1 width=216) (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_pes (...)
6. 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
7. 0.000 0.000 ↓ 0.0

Hash (cost=540.45..540.45 rows=19 width=282) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=406.76..540.45 rows=19 width=282) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=406.62..536.71 rows=19 width=272) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash Join (cost=406.34..530.51 rows=19 width=272) (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=403.95..527.48 rows=31 width=158) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=403.67..472.76 rows=62 width=91) (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=135.93..161.05 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..123.29 rows=2,529 width=8) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=264.00..264.00 rows=249 width=91) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.34..264.00 rows=249 width=91) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

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

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

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

19. 0.000 0.000 ↓ 0.0

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

20. 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)
21. 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=)

22. 0.000 0.000 ↓ 0.0

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

23. 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)
24. 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=)

25. 0.000 0.000 ↓ 0.0

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

26. 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
27. 0.000 0.000 ↓ 0.0

Index Scan using pk_chegada on tb_chegada ch (cost=0.28..0.49 rows=1 width=91) (actual rows= loops=)

  • Index Cond: (id_chegada = t10_.id_chegada)
  • Filter: in_ativo
28. 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))
29. 0.000 0.000 ↓ 0.0

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

30. 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[])))
31.          

SubPlan (for Hash Join)

32. 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))
33. 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)
34. 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)
35.          

SubPlan (for Hash Right Join)

36. 0.000 0.000 ↓ 0.0

Limit (cost=1,092.48..1,092.49 rows=1 width=8) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Sort (cost=1,092.48..1,092.49 rows=1 width=8) (actual rows= loops=)

  • Sort Key: t15_.dt_alteracao
38. 0.000 0.000 ↓ 0.0

Seq Scan on tb_historico_situacao_cadastro t15_ (cost=0.00..1,092.47 rows=1 width=8) (actual rows= loops=)

  • Filter: ((id_situacao_cadastro = 7) AND (id_pessoa = t0_.id_pessoa))
39. 0.000 0.000 ↓ 0.0

Limit (cost=2,566.58..2,566.59 rows=1 width=18) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Sort (cost=2,566.58..2,566.59 rows=1 width=18) (actual rows= loops=)

  • Sort Key: t16_.dt_expedicao
41. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=332.86..2,566.57 rows=1 width=18) (actual rows= loops=)

  • Hash Cond: (t16_.id_solicitacao = t17_.id_solicitacao)
42. 0.000 0.000 ↓ 0.0

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

43. 0.000 0.000 ↓ 0.0

Hash (cost=332.85..332.85 rows=1 width=16) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Seq Scan on tb_solicitacao t17_ (cost=0.00..332.85 rows=1 width=16) (actual rows= loops=)

  • Filter: (in_ativo AND (t0_.id_pessoa = id_pessoa))
45. 0.000 0.000 ↓ 0.0

Limit (cost=2,566.58..2,566.59 rows=1 width=18) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Sort (cost=2,566.58..2,566.59 rows=1 width=18) (actual rows= loops=)

  • Sort Key: t18_.dt_expedicao
47. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=332.86..2,566.57 rows=1 width=18) (actual rows= loops=)

  • Hash Cond: (t18_.id_solicitacao = t19_.id_solicitacao)
48. 0.000 0.000 ↓ 0.0

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

49. 0.000 0.000 ↓ 0.0

Hash (cost=332.85..332.85 rows=1 width=16) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Seq Scan on tb_solicitacao t19_ (cost=0.00..332.85 rows=1 width=16) (actual rows= loops=)

  • Filter: (in_ativo AND (t5_.id_pessoa = id_pessoa))
51. 0.000 0.000 ↓ 0.0

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

52. 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
53. 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)
54. 0.000 0.000 ↓ 0.0

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

55. 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
56. 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)
57. 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=)

58. 0.000 0.000 ↓ 0.0

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

59. 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