explain.depesz.com

PostgreSQL's explain analyze made readable

Result: q7Tn

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 336.431 ↑ 235.0 1 1

Sort (cost=249.25..249.31 rows=235 width=33) (actual time=336.431..336.431 rows=1 loops=1)

  • Sort Key: (CASE WHEN ((tb_as_portfolio.tp_portfolio_view)::text = 'CONS'::text) THEN 1 ELSE 0 END)
  • Sort Method: quicksort Memory: 25kB
2. 0.224 336.412 ↑ 235.0 1 1

GroupAggregate (cost=247.62..248.32 rows=235 width=33) (actual time=336.411..336.412 rows=1 loops=1)

  • Group Key: tb_as_reprocessing_request_portfolio.id_contract, tb_as_reprocessing_request_portfolio.id_portfolio, tb_asset_fund.dt_start, tb_as_portfolio.tp_portfolio_view
3. 0.906 336.188 ↓ 4.0 941 1

Sort (cost=247.62..247.68 rows=235 width=25) (actual time=336.145..336.188 rows=941 loops=1)

  • Sort Key: tb_as_reprocessing_request_portfolio.id_portfolio, tb_asset_fund.dt_start, tb_as_portfolio.tp_portfolio_view
  • Sort Method: quicksort Memory: 98kB
4. 0.547 335.282 ↓ 4.0 941 1

Nested Loop Left Join (cost=0.20..246.69 rows=235 width=25) (actual time=7.770..335.282 rows=941 loops=1)

5. 0.018 6.753 ↑ 1.0 1 1

Nested Loop (cost=0.14..4.19 rows=1 width=21) (actual time=6.736..6.753 rows=1 loops=1)

  • Join Filter: (tb_as_reprocessing_request_portfolio.id_portfolio = tb_as_portfolio.id_portfolio)
6. 0.023 1.465 ↑ 1.0 1 1

Nested Loop (cost=0.10..4.10 rows=1 width=24) (actual time=1.449..1.465 rows=1 loops=1)

7. 1.307 1.307 ↑ 1.0 1 1

Index Only Scan using tb_as_reprocessing_request_portfolio_pkey on tb_as_reprocessing_request_portfolio (cost=0.06..2.06 rows=1 width=16) (actual time=1.303..1.307 rows=1 loops=1)

  • Index Cond: ((id_contract = 2020) AND (id_asset = 97) AND (id_request = 54388536))
  • Heap Fetches: 1
8. 0.135 0.135 ↑ 1.0 1 1

Index Scan using tb_asset_fund_id_asset_id_portfolio_idx on tb_asset_fund (cost=0.04..2.04 rows=1 width=16) (actual time=0.128..0.135 rows=1 loops=1)

  • Index Cond: ((id_asset = 97) AND (id_portfolio = tb_as_reprocessing_request_portfolio.id_portfolio))
9. 5.270 5.270 ↑ 1.0 1 1

Index Scan using tb_as_portfolio_pk on tb_as_portfolio (cost=0.04..0.08 rows=1 width=15) (actual time=5.270..5.270 rows=1 loops=1)

  • Index Cond: ((id_contract = 2020) AND (id_portfolio = tb_asset_fund.id_portfolio))
10. 327.982 327.982 ↓ 1.4 941 1

Index Only Scan using tb_as_posi_day_pk on tb_as_posi_day (cost=0.06..241.85 rows=659 width=14) (actual time=1.015..327.982 rows=941 loops=1)

  • Index Cond: ((id_contract = tb_as_reprocessing_request_portfolio.id_contract) AND (id_contract = 2020) AND (id_portfolio = tb_as_reprocessing_request_portfolio.id_portfolio))
  • Heap Fetches: 943
Planning time : 4.327 ms
Execution time : 336.708 ms