explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nbTh

Settings
# exclusive inclusive rows x rows loops node
1. 1.593 4,447.566 ↑ 67.6 5,961 1

Unique (cost=311,136.27..319,197.65 rows=403,069 width=179) (actual time=4,444.874..4,447.566 rows=5,961 loops=1)

2. 17.414 4,445.973 ↑ 59.9 6,732 1

Sort (cost=311,136.27..312,143.94 rows=403,069 width=179) (actual time=4,444.871..4,445.973 rows=6,732 loops=1)

  • Sort Key: (replace((f.ds_razao_social)::text, '\'::text, ''::text)), rh.id_rh, rh.flg_status, f.cpf, frh.ds_funcao_rh, ch.ds_carga_horaria, rh.id_fornecedor
  • Sort Method: external sort Disk: 1,216kB
3. 266.103 4,428.559 ↑ 59.9 6,732 1

Group (cost=153,041.95..166,141.70 rows=403,069 width=179) (actual time=3,966.354..4,428.559 rows=6,732 loops=1)

4. 3,841.657 4,162.456 ↓ 1.2 482,860 1

Sort (cost=153,041.95..154,049.63 rows=403,069 width=179) (actual time=3,966.349..4,162.456 rows=482,860 loops=1)

  • Sort Key: (replace((f.ds_razao_social)::text, '\'::text, ''::text)), rh.id_rh, rhe.id_entidade_conveniada, rhe.id_funcao_rh, frh.ds_funcao_rh, rhe.id_cargo_rh, crh.ds_cargo_rh, rhe.id_carga_horaria, ch.ds_carga_horaria, rhe.id_situacao_ (...)
  • Sort Method: external merge Disk: 87,640kB
5. 220.954 320.799 ↓ 1.2 482,860 1

Hash Join (cost=1,770.22..8,047.39 rows=403,069 width=179) (actual time=63.185..320.799 rows=482,860 loops=1)

  • Hash Cond: (rhe.id_entidade_conveniada = ec.id_entidade_conveniada)
6. 6.397 73.518 ↓ 1.1 6,743 1

Hash Join (cost=912.64..1,672.85 rows=6,159 width=179) (actual time=36.832..73.518 rows=6,743 loops=1)

  • Hash Cond: (rhe.id_cargo_rh = crh.id_cargo_rh)
7. 4.277 64.648 ↓ 1.1 6,743 1

Hash Join (cost=794.88..1,453.63 rows=6,378 width=143) (actual time=34.325..64.648 rows=6,743 loops=1)

  • Hash Cond: (rhe.id_carga_horaria = ch.id_carga_horaria)
8. 20.994 60.334 ↓ 1.0 6,743 1

Hash Join (cost=792.80..1,363.01 rows=6,605 width=92) (actual time=34.269..60.334 rows=6,743 loops=1)

  • Hash Cond: (f.id_fornecedor = rh.id_fornecedor)
9. 5.459 5.459 ↑ 1.0 16,358 1

Seq Scan on tb_fornecedor f (cost=0.00..340.58 rows=16,358 width=48) (actual time=0.005..5.459 rows=16,358 loops=1)

10. 6.098 33.881 ↓ 1.0 6,743 1

Hash (cost=710.23..710.23 rows=6,605 width=48) (actual time=33.881..33.881 rows=6,743 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 566kB
11. 6.053 27.783 ↓ 1.0 6,743 1

Hash Join (cost=302.21..710.23 rows=6,605 width=48) (actual time=8.812..27.783 rows=6,743 loops=1)

  • Hash Cond: (rhe.id_funcao_rh = frh.id_funcao_rh)
12. 10.843 21.697 ↓ 1.0 6,938 1

Hash Join (cost=300.24..616.57 rows=6,840 width=30) (actual time=8.761..21.697 rows=6,938 loops=1)

  • Hash Cond: (rhe.id_rh = rh.id_rh)
13. 2.114 2.114 ↑ 1.0 7,526 1

Seq Scan on tb_rh_entidade rhe (cost=0.00..163.26 rows=7,526 width=24) (actual time=0.004..2.114 rows=7,526 loops=1)

14. 2.714 8.740 ↑ 1.0 6,675 1

Hash (cost=216.80..216.80 rows=6,675 width=10) (actual time=8.740..8.740 rows=6,675 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 287kB
15. 6.026 6.026 ↑ 1.0 6,675 1

Seq Scan on tb_rh rh (cost=0.00..216.80 rows=6,675 width=10) (actual time=0.014..6.026 rows=6,675 loops=1)

  • Filter: (flg_status <> 'I'::bpchar)
  • Rows Removed by Filter: 669
16. 0.019 0.033 ↑ 1.0 43 1

Hash (cost=1.43..1.43 rows=43 width=22) (actual time=0.033..0.033 rows=43 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 3kB
17. 0.014 0.014 ↑ 1.0 43 1

Seq Scan on tb_funcao_rh frh (cost=0.00..1.43 rows=43 width=22) (actual time=0.003..0.014 rows=43 loops=1)

18. 0.018 0.037 ↑ 1.0 48 1

Hash (cost=1.48..1.48 rows=48 width=55) (actual time=0.037..0.037 rows=48 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 5kB
19. 0.019 0.019 ↑ 1.0 48 1

Seq Scan on tb_carga_horaria ch (cost=0.00..1.48 rows=48 width=55) (actual time=0.004..0.019 rows=48 loops=1)

20. 1.312 2.473 ↑ 1.0 3,145 1

Hash (cost=78.45..78.45 rows=3,145 width=40) (actual time=2.473..2.473 rows=3,145 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 228kB
21. 1.161 1.161 ↑ 1.0 3,145 1

Seq Scan on tb_cargo_rh crh (cost=0.00..78.45 rows=3,145 width=40) (actual time=0.007..1.161 rows=3,145 loops=1)

22. 7.039 26.327 ↓ 1.0 19,005 1

Hash (cost=620.10..620.10 rows=18,998 width=8) (actual time=26.327..26.327 rows=19,005 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 743kB
23. 11.424 19.288 ↓ 1.0 19,005 1

Hash Join (cost=16.21..620.10 rows=18,998 width=8) (actual time=0.200..19.288 rows=19,005 loops=1)

  • Hash Cond: (eu.id_entidade_conveniada = ec.id_entidade_conveniada)
24. 7.690 7.690 ↑ 1.0 19,005 1

Seq Scan on tb_entidade_usuario eu (cost=0.00..342.65 rows=19,005 width=4) (actual time=0.015..7.690 rows=19,005 loops=1)

  • Filter: (id_unidade_adm = 2)
  • Rows Removed by Filter: 7
25. 0.088 0.174 ↑ 1.0 293 1

Hash (cost=12.54..12.54 rows=293 width=4) (actual time=0.174..0.174 rows=293 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
26. 0.086 0.086 ↑ 1.0 293 1

Index Only Scan using pk_tb_unidade_conveniada on tb_entidade_conveniada ec (cost=0.15..12.54 rows=293 width=4) (actual time=0.021..0.086 rows=293 loops=1)

  • Heap Fetches: 0
Total runtime : 4,463.420 ms