explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rxJ2 : Optimization for: plan #oacY

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 71.476 347.682 ↑ 1.0 80,111 1

Unique (cost=36,539.20..52,561.40 rows=80,111 width=879) (actual time=250.365..347.682 rows=80,111 loops=1)

2. 116.567 276.206 ↑ 1.0 80,111 1

Sort (cost=36,539.20..36,739.48 rows=80,111 width=879) (actual time=250.363..276.206 rows=80,111 loops=1)

  • Sort Key: usuario0_.id, cargousuar1_.id, funcao2_.id, centrocust3_.id, usuario4_.id, usuario0_.last_update, usuario0_.nick_name, usuario0_.id_position, usuario0_.chefia_imediata, usuario0_.codigo_desbloqueio_impressao, usuario0_.cpf_cnpj, usuario0_.termination_date, usuario0_.data_exercicio, usuario0_.data_posse, usuario0_.email, usuario0_.address, usuario0_.fatura_modo_classico, usuario0_.id_function, usuario0_.imagem_perfil, usuario0_.ldap, usuario0_.login, usuario0_.id_cc_operation, usuario0_.id_cc_gratification, usuario0_.id_cc_appointment, usuario0_.matricula, usuario0_.name, usuario0_.extension_number, usuario0_.extension_number_pes, usuario0_.initial_page, usuario0_.password, usuario0_.senha_expirada, usuario0_.status, cargousuar1_.last_update, cargousuar1_.cod_pes, cargousuar1_.description, cargousuar1_.tem_limit, cargousuar1_.no_limit, funcao2_.last_update, funcao2_.cod_pes, funcao2_.description, funcao2_.no_limit, centrocust3_.last_update, centrocust3_.id_father_cost_center, centrocust3_.final_structural_code, centrocust3_.initial_structural_code, centrocust3_.cod_pes, centrocust3_.description, centrocust3_.id_manager_cost_center, centrocust3_.id_sub_manager_cost_center, centrocust3_.name, centrocust3_.seq_hierarchical, centrocust3_.status, usuario4_.last_update, usuario4_.nick_name, usuario4_.id_position, usuario4_.chefia_imediata, usuario4_.codigo_desbloqueio_impressao, usuario4_.cpf_cnpj, usuario4_.termination_date, usuario4_.data_exercicio, usuario4_.data_posse, usuario4_.email, usuario4_.address, usuario4_.fatura_modo_classico, usuario4_.id_function, usuario4_.imagem_perfil, usuario4_.ldap, usuario4_.login, usuario4_.id_cc_operation, usuario4_.id_cc_gratification, usuario4_.id_cc_appointment, usuario4_.matricula, usuario4_.name, usuario4_.extension_number, usuario4_.extension_number_pes, usuario4_.initial_page, usuario4_.password, usuario4_.senha_expirada, usuario4_.status
  • Sort Method: external merge Disk: 29,264kB
3. 33.102 159.639 ↑ 1.0 80,111 1

Hash Left Join (cost=137.59..11,890.23 rows=80,111 width=879) (actual time=0.902..159.639 rows=80,111 loops=1)

  • Hash Cond: (usuario0_.id_cc_operation = centrocust3_.id)
4. 24.431 125.732 ↑ 1.0 80,111 1

Hash Left Join (cost=47.00..10,502.99 rows=80,111 width=797) (actual time=0.095..125.732 rows=80,111 loops=1)

  • Hash Cond: (usuario0_.id_function = funcao2_.id)
5. 24.498 101.296 ↑ 1.0 80,111 1

Hash Left Join (cost=45.80..9,400.29 rows=80,111 width=562) (actual time=0.086..101.296 rows=80,111 loops=1)

  • Hash Cond: (usuario0_.id_position = cargousuar1_.id)
6. 35.277 76.752 ↑ 1.0 80,111 1

Merge Left Join (cost=40.40..8,295.88 rows=80,111 width=526) (actual time=0.035..76.752 rows=80,111 loops=1)

  • Merge Cond: (usuario0_.chefia_imediata = usuario4_.id)
7. 25.665 25.665 ↑ 1.0 80,111 1

Index Scan using idx_tem_user_chefia on tem_user usuario0_ (cost=0.29..3,834.22 rows=80,111 width=263) (actual time=0.007..25.665 rows=80,111 loops=1)

8. 15.810 15.810 ↑ 1.4 55,400 1

Index Scan using pk_user on tem_user usuario4_ (cost=0.29..3,827.80 rows=80,111 width=263) (actual time=0.004..15.810 rows=55,400 loops=1)

9. 0.022 0.046 ↑ 1.0 151 1

Hash (cost=3.51..3.51 rows=151 width=36) (actual time=0.046..0.046 rows=151 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
10. 0.024 0.024 ↑ 1.0 151 1

Seq Scan on tem_position cargousuar1_ (cost=0.00..3.51 rows=151 width=36) (actual time=0.002..0.024 rows=151 loops=1)

11. 0.000 0.005 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=235) (actual time=0.005..0.005 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
12. 0.005 0.005 ↑ 1.0 9 1

Seq Scan on tem_function funcao2_ (cost=0.00..1.09 rows=9 width=235) (actual time=0.002..0.005 rows=9 loops=1)

13. 0.805 0.805 ↑ 1.0 2,737 1

Hash (cost=56.37..56.37 rows=2,737 width=82) (actual time=0.805..0.805 rows=2,737 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 214kB
  • -> Seq Scan on tem_cost_center centrocust3_ (cost=0.00..56.37 rows=2,737 width=82) (actual time=0.001..0.410 rows=2,737 loops=1)"Total runtime: 353.801 ms