explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jo6D

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

Subquery Scan on tmp (cost=5,505.79..6,546.13 rows=2 width=1,255) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Append (cost=5,505.79..6,546.11 rows=2 width=800) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

WindowAgg (cost=5,505.79..5,522.50 rows=1 width=325) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,505.79..5,522.48 rows=1 width=325) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,505.50..5,515.17 rows=1 width=321) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,505.37..5,514.40 rows=1 width=105) (actual rows= loops=)

  • Join Filter: (tiposolicitacao.id_tipo_solicitacao = subtiposolicitacao.id_tipo_solicitacao)
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5,505.22..5,512.22 rows=1 width=69) (actual rows= loops=)

  • Join Filter: (((solicitacao.id_pessoa = 16,031) AND (tiposolicitacao.id_tipo_solicitacao = 2)) OR (((solicitacao.co_protocolo)::text = ANY ('{1046161555103273042019,1134561551453747032019,9912231549032337022019}'::text[ (...)
8. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=5,505.22..5,505.37 rows=20 width=63) (actual rows= loops=)

  • Merge Cond: ((solicitacao.co_protocolo)::text = (solicitacaolida.co_protocolo)::text)
9. 0.000 0.000 ↓ 0.0

Sort (cost=5,408.89..5,408.94 rows=20 width=62) (actual rows= loops=)

  • Sort Key: solicitacao.co_protocolo
10. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=5,215.73..5,408.46 rows=20 width=62) (actual rows= loops=)

  • Hash Cond: (sub_compartilhamento.id_solicitacao = solicitacao.id_solicitacao)
11. 0.000 0.000 ↓ 0.0

HashAggregate (cost=5,118.94..5,200.08 rows=8,114 width=16) (actual rows= loops=)

  • Group Key: sub_compartilhamento.id_solicitacao, subtipo_solicitacao_interna.id_tipo_solicitacao, solicitacao_interna.id_subtipo_solicitacao, solicitacao_interna.id_tipo_status
12. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=4,504.02..5,017.51 rows=8,114 width=16) (actual rows= loops=)

  • Hash Cond: (solicitacao_interna.id_subtipo_solicitacao = subtipo_solicitacao_interna.id_subtipo_solicitacao)
13. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=4,491.58..4,893.51 rows=8,114 width=12) (actual rows= loops=)

  • Hash Cond: (sub_compartilhamento.id_solicitacao = solicitacao_interna.id_solicitacao)
14. 0.000 0.000 ↓ 0.0

Seq Scan on tb_compartilhamento sub_compartilhamento (cost=0.00..224.31 rows=8,114 width=4) (actual rows= loops=)

  • Filter: (dt_exclusao IS NULL)
15. 0.000 0.000 ↓ 0.0

Hash (cost=3,522.37..3,522.37 rows=77,537 width=12) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on tb_solicitacao solicitacao_interna (cost=0.00..3,522.37 rows=77,537 width=12) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash (cost=9.97..9.97 rows=197 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on tb_subtipo_solicitacao subtipo_solicitacao_interna (cost=0.00..9.97 rows=197 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=96.55..96.55 rows=20 width=54) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_solicitacao solicitacao (cost=17.71..96.55 rows=20 width=54) (actual rows= loops=)

  • Recheck Cond: ((id_pessoa = 16,031) OR ((co_protocolo)::text = ANY ('{1046161555103273042019,1134561551453747032019,9912231549032337022019}'::text[])))
  • Filter: ((id_solicitacao_pai IS NULL) AND (id_unidade_administrativa IS NULL))
21. 0.000 0.000 ↓ 0.0

BitmapOr (cost=17.71..17.71 rows=21 width=0) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ind_solicitacao_id_pessoa (cost=0.00..4.43 rows=18 width=0) (actual rows= loops=)

  • Index Cond: (id_pessoa = 16,031)
23. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ind_tb_solicitacao_co_protocolo (cost=0.00..13.28 rows=3 width=0) (actual rows= loops=)

  • Index Cond: ((co_protocolo)::text = ANY ('{1046161555103273042019,1134561551453747032019,9912231549032337022019}'::text[]))
24. 0.000 0.000 ↓ 0.0

Sort (cost=96.33..96.35 rows=9 width=23) (actual rows= loops=)

  • Sort Key: solicitacaolida.co_protocolo
25. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_solicitacao_lida solicitacaolida (cost=4.61..96.19 rows=9 width=23) (actual rows= loops=)

  • Recheck Cond: (id_pessoa = 16,031)
  • Filter: (NOT in_administrador)
26. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ind_solicitacao_lida_id_pessoa (cost=0.00..4.61 rows=25 width=0) (actual rows= loops=)

  • Index Cond: (id_pessoa = 16,031)
27. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.18 rows=12 width=10) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Seq Scan on tb_tipo_solicitacao tiposolicitacao (cost=0.00..1.12 rows=12 width=10) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Index Scan using idx_id_subtipo_solicitacao on tb_subtipo_solicitacao subtiposolicitacao (cost=0.14..2.17 rows=1 width=44) (actual rows= loops=)

  • Index Cond: (id_subtipo_solicitacao = solicitacao.id_subtipo_solicitacao)
30. 0.000 0.000 ↓ 0.0

Index Scan using idx_id_tipo_status on tb_tipo_status tipostatus (cost=0.14..0.75 rows=1 width=220) (actual rows= loops=)

  • Index Cond: (id_tipo_status = solicitacao.id_tipo_status)
31. 0.000 0.000 ↓ 0.0

Index Only Scan using ind_usuario_id_pessoa_id_usuario on tb_usuario u (cost=0.29..7.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_pessoa = solicitacao.id_pessoa)
32. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=711.78..1,023.60 rows=1 width=1,276) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=711.78..1,023.59 rows=1 width=1,276) (actual rows= loops=)

  • Join Filter: ((t1.co_protocolo)::text = (solicitacaolida_1.co_protocolo)::text)
34. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=707.17..927.27 rows=1 width=1,246) (actual rows= loops=)

  • Hash Cond: (upper((t1.no_tipo_status)::text) = (ts.no_tipo_status)::text)
35. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=705.86..925.94 rows=1 width=1,144) (actual rows= loops=)

  • Hash Cond: (((sub_compartilhamento_1.co_protocolo)::text) = (t1.co_protocolo)::text)
  • Filter: (((u_1.id_pessoa = 16,031) AND (t1.id_tipo_solicitacao = 2)) OR (((t1.co_protocolo)::text = ANY ('{1046161555103273042019,1134561551453747032019,9912231549032337022019}'::text[])) AND (t1_1.id_tipo_solicitacao = 2)))
36. 0.000 0.000 ↓ 0.0

HashAggregate (cost=531.06..612.20 rows=8,114 width=32) (actual rows= loops=)

  • Group Key: sub_compartilhamento_1.co_protocolo, t1_1.id_tipo_solicitacao, t1_1.id_subtipo_solicitacao, tipo_status_interna.id_tipo_status
37. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=327.05..429.63 rows=8,114 width=32) (actual rows= loops=)

  • Hash Cond: ((t1_1.co_protocolo)::text = (sub_compartilhamento_1.co_protocolo)::text)
38. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1.32..18.27 rows=1,000 width=130) (actual rows= loops=)

  • Hash Cond: (lower((t1_1.no_tipo_status)::text) = lower((tipo_status_interna.no_tipo_status)::text))
39. 0.000 0.000 ↓ 0.0

Function Scan on dblink t1_1 (cost=0.00..10.00 rows=1,000 width=244) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash (cost=1.14..1.14 rows=14 width=122) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Seq Scan on tb_tipo_status tipo_status_interna (cost=0.00..1.14 rows=14 width=122) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Hash (cost=224.31..224.31 rows=8,114 width=20) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Seq Scan on tb_compartilhamento sub_compartilhamento_1 (cost=0.00..224.31 rows=8,114 width=20) (actual rows= loops=)

  • Filter: (dt_exclusao IS NULL)
44. 0.000 0.000 ↓ 0.0

Hash (cost=174.55..174.55 rows=20 width=1,112) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..174.55 rows=20 width=1,112) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Function Scan on dblink t1 (cost=0.00..16.25 rows=20 width=1,620) (actual rows= loops=)

  • Filter: ((id_tipo_solicitacao = 2) OR ((co_protocolo)::text = ANY ('{1046161555103273042019,1134561551453747032019,9912231549032337022019}'::text[])))
47. 0.000 0.000 ↓ 0.0

Index Scan using idx_no_login on tb_usuario u_1 (cost=0.29..7.91 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((no_login)::text = (t1.reporter_id_pessoa)::text)
48. 0.000 0.000 ↓ 0.0

Hash (cost=1.14..1.14 rows=14 width=220) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Seq Scan on tb_tipo_status ts (cost=0.00..1.14 rows=14 width=220) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_solicitacao_lida solicitacaolida_1 (cost=4.61..96.19 rows=9 width=30) (actual rows= loops=)

  • Recheck Cond: (id_pessoa = 16,031)
  • Filter: (NOT in_administrador)
51. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ind_solicitacao_lida_id_pessoa (cost=0.00..4.61 rows=25 width=0) (actual rows= loops=)

  • Index Cond: (id_pessoa = 16,031)