explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4AbG

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 2,017.802 ↓ 0.0 0 1

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

  • Join Filter: ((t1.co_protocolo)::text = (solicitacaolida.co_protocolo)::text)
2. 0.001 2,017.801 ↓ 0.0 0 1

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

  • Hash Cond: (upper((t1.no_tipo_status)::text) = (ts.no_tipo_status)::text)
3. 26.860 2,017.800 ↓ 0.0 0 1

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

  • Hash Cond: (((sub_compartilhamento.co_protocolo)::text) = (t1.co_protocolo)::text)
  • Filter: (((u.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)))
  • Rows Removed by Filter: 60,910
4. 3.478 880.406 ↑ 1.5 5,268 1

HashAggregate (cost=531.06..612.20 rows=8,114 width=32) (actual time=879.364..880.406 rows=5,268 loops=1)

  • Group Key: sub_compartilhamento.co_protocolo, t1_1.id_tipo_solicitacao, t1_1.id_subtipo_solicitacao, tipo_status_interna.id_tipo_status
5. 12.932 876.928 ↓ 1.0 8,371 1

Hash Right Join (cost=327.05..429.63 rows=8,114 width=32) (actual time=802.908..876.928 rows=8,371 loops=1)

  • Hash Cond: ((t1_1.co_protocolo)::text = (sub_compartilhamento.co_protocolo)::text)
6. 56.859 861.043 ↓ 61.4 61,426 1

Hash Left Join (cost=1.32..18.27 rows=1,000 width=130) (actual time=799.927..861.043 rows=61,426 loops=1)

  • Hash Cond: (lower((t1_1.no_tipo_status)::text) = lower((tipo_status_interna.no_tipo_status)::text))
7. 804.149 804.149 ↓ 61.4 61,426 1

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

8. 0.017 0.035 ↓ 1.1 15 1

Hash (cost=1.14..1.14 rows=14 width=122) (actual time=0.035..0.035 rows=15 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
9. 0.018 0.018 ↓ 1.1 15 1

Seq Scan on tb_tipo_status tipo_status_interna (cost=0.00..1.14 rows=14 width=122) (actual time=0.016..0.018 rows=15 loops=1)

10. 1.412 2.953 ↓ 1.0 8,371 1

Hash (cost=224.31..224.31 rows=8,114 width=20) (actual time=2.953..2.953 rows=8,371 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 431kB
11. 1.541 1.541 ↓ 1.0 8,371 1

Seq Scan on tb_compartilhamento sub_compartilhamento (cost=0.00..224.31 rows=8,114 width=20) (actual time=0.006..1.541 rows=8,371 loops=1)

  • Filter: (dt_exclusao IS NULL)
  • Rows Removed by Filter: 229
12. 19.782 1,110.534 ↓ 3,045.5 60,910 1

Hash (cost=174.55..174.55 rows=20 width=1,112) (actual time=1,110.534..1,110.534 rows=60,910 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 7,148kB
13. 44.882 1,090.752 ↓ 3,045.5 60,910 1

Nested Loop (cost=0.29..174.55 rows=20 width=1,112) (actual time=789.150..1,090.752 rows=60,910 loops=1)

14. 800.166 800.166 ↓ 3,071.3 61,426 1

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

  • Filter: ((id_tipo_solicitacao = 2) OR ((co_protocolo)::text = ANY ('{1046161555103273042019,1134561551453747032019,9912231549032337022019}'::text[])))
15. 245.704 245.704 ↑ 1.0 1 61,426

Index Scan using idx_no_login on tb_usuario u (cost=0.29..7.91 rows=1 width=22) (actual time=0.004..0.004 rows=1 loops=61,426)

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

Hash (cost=1.14..1.14 rows=14 width=220) (never executed)

17. 0.000 0.000 ↓ 0.0 0

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

18. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_solicitacao_lida solicitacaolida (cost=4.61..96.19 rows=9 width=30) (never executed)

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

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

  • Index Cond: (id_pessoa = 16,031)
Planning time : 0.784 ms
Execution time : 2,022.226 ms