explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yxvx

Settings
# exclusive inclusive rows x rows loops node
1. 8,116.683 37,355.719 ↓ 0.0 0 1

Gather Merge (cost=115,245.22..116,374.40 rows=9,678 width=79) (actual time=37,326.201..37,355.719 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.146 29,239.036 ↓ 0.0 0 3 / 3

Sort (cost=114,245.20..114,257.30 rows=4,839 width=79) (actual time=29,239.036..29,239.036 rows=0 loops=3)

  • Sort Key: tb_dist_v_pos_geral_cot.cod_cot, tb_dist_v_pos_geral_cot.cod_prod, tb_dist_v_pos_geral_cot.cert, tb_dist_v_pos_geral_cot.dt_aplic
  • Sort Method: quicksort Memory: 25kB
  • Worker 0: Sort Method: quicksort Memory: 25kB
  • Worker 1: Sort Method: quicksort Memory: 25kB
3. 0.205 29,238.890 ↓ 0.0 0 3 / 3

Hash Join (cost=539.06..113,949.04 rows=4,839 width=79) (actual time=29,238.890..29,238.890 rows=0 loops=3)

  • Hash Cond: ((tb_dist_v_pos_geral_cot.cod_cot)::text = (tb_dist_mini_codcot_cpf_jn.cod_cot)::text)
4. 12,938.747 29,235.274 ↓ 0.0 0 3 / 3

Hash Join (cost=364.39..113,761.65 rows=4,839 width=67) (actual time=29,235.274..29,235.274 rows=0 loops=3)

  • Hash Cond: (tb_dist_mini_cod_prod_dist_custody_jn.id_instrument = tb_dist_fund_selected.id_instrument)
  • Join Filter: (NOT (SubPlan 1))
  • Rows Removed by Join Filter: 71
5. 0.494 15.581 ↑ 136.3 71 3 / 3

Hash Join (cost=276.04..8,504.08 rows=9,678 width=71) (actual time=5.317..15.581 rows=71 loops=3)

  • Hash Cond: (((tb_dist_v_pos_geral_cot.cod_cot)::text = (tb_dist_mini_cod_prod_dist_custody_jn.cod_cot)::text) AND ((tb_dist_v_pos_geral_cot.cod_prod)::text = (tb_dist_mini_cod_prod_dist_custody_jn.cod_prod)::text))
6. 9.863 9.863 ↑ 1,052.3 71 3 / 3

Parallel Seq Scan on tb_dist_v_pos_geral_cot (cost=0.00..5,142.87 rows=74,710 width=49) (actual time=0.035..9.863 rows=71 loops=3)

  • Filter: (id_contract = 8)
7. 2.225 5.224 ↓ 1.0 7,756 3 / 3

Hash (cost=160.93..160.93 rows=7,674 width=29) (actual time=5.224..5.224 rows=7,756 loops=3)

  • Buckets: 8192 Batches: 1 Memory Usage: 549kB
8. 2.999 2.999 ↓ 1.0 7,756 3 / 3

Seq Scan on tb_dist_mini_cod_prod_dist_custody_jn (cost=0.00..160.93 rows=7,674 width=29) (actual time=0.033..2.999 rows=7,756 loops=3)

  • Filter: (id_contract = 8)
9. 0.190 1.427 ↓ 1.0 815 3 / 3

Hash (cost=78.17..78.17 rows=814 width=12) (actual time=1.427..1.427 rows=815 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 44kB
10. 1.237 1.237 ↓ 1.0 815 3 / 3

Seq Scan on tb_dist_fund_selected (cost=0.00..78.17 rows=814 width=12) (actual time=0.038..1.237 rows=815 loops=3)

  • Filter: (id_contract = 8)
11.          

SubPlan (for Hash Join)

12. 6,153.268 16,279.519 ↑ 1.2 751,249 213 / 3

Materialize (cost=0.00..32,774.52 rows=909,344 width=38) (actual time=0.005..229.289 rows=751,249 loops=213)

13. 10,126.251 10,126.251 ↑ 1.2 745,691 128 / 3

Seq Scan on tb_dist_mini_certificate_pos_geral_cot_jn (cost=0.00..21,122.80 rows=909,344 width=38) (actual time=0.004..237.334 rows=745,691 loops=128)

  • Filter: (id_contract = 8)
14. 1.244 3.411 ↑ 1.0 4,427 3 / 3

Hash (cost=119.34..119.34 rows=4,427 width=22) (actual time=3.411..3.411 rows=4,427 loops=3)

  • Buckets: 8192 Batches: 1 Memory Usage: 318kB
15. 2.167 2.167 ↑ 1.0 4,427 3 / 3

Seq Scan on tb_dist_mini_codcot_cpf_jn (cost=0.00..119.34 rows=4,427 width=22) (actual time=0.037..2.167 rows=4,427 loops=3)

  • Filter: (id_contract = 8)
Planning time : 4.328 ms
Execution time : 37,370.044 ms