explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6bg7

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 81.018 ↓ 2.0 2 1

Nested Loop Left Join (cost=0.19..11,101.97 rows=1 width=28) (actual time=54.946..81.018 rows=2 loops=1)

2. 0.009 73.693 ↑ 1.0 1 1

Nested Loop (cost=0.13..11,088.65 rows=1 width=22) (actual time=54.845..73.693 rows=1 loops=1)

3. 0.009 73.650 ↑ 1.0 1 1

Nested Loop (cost=0.09..11,086.60 rows=1 width=34) (actual time=54.806..73.650 rows=1 loops=1)

4. 73.608 73.608 ↑ 1.0 1 1

Index Scan using tb_as_portfolio_pk on tb_as_portfolio (cost=0.04..11,084.56 rows=1 width=26) (actual time=54.771..73.608 rows=1 loops=1)

  • Index Cond: (id_portfolio = '1850459'::bigint)
  • Filter: (id_asset = '97'::bigint)
5. 0.033 0.033 ↑ 1.0 1 1

Index Scan using tb_asset_fund_id_asset_id_portfolio_idx on tb_asset_fund (cost=0.04..2.05 rows=1 width=20) (actual time=0.028..0.033 rows=1 loops=1)

  • Index Cond: ((id_asset = '97'::bigint) AND (id_portfolio = '1850459'::bigint))
6. 0.034 0.034 ↑ 1.0 1 1

Index Scan using tb_as_account_id_asset_account_number_idx on tb_as_account (cost=0.04..2.05 rows=1 width=15) (actual time=0.031..0.034 rows=1 loops=1)

  • Index Cond: ((id_asset = '97'::bigint) AND ((account_number)::text = ((tb_as_portfolio.account)::text || (COALESCE((tb_as_portfolio.account_digit)::character varying, ''::character varying))::text)))
7. 7.192 7.192 ↑ 10.0 2 1

Index Scan using tb_as_portfolio_account_pk on tb_as_portfolio_account (cost=0.06..13.05 rows=20 width=16) (actual time=0.025..7.192 rows=2 loops=1)

  • Index Cond: ((id_contract = tb_as_portfolio.id_contract) AND (id_portfolio = tb_as_portfolio.id_portfolio) AND (id_portfolio = '1850459'::bigint))
  • Filter: is_currency_default
  • Rows Removed by Filter: 2,157
8.          

SubPlan (for Nested Loop Left Join)

9. 0.006 0.114 ↑ 1.0 1 2

Result (cost=0.24..0.24 rows=1 width=4) (actual time=0.057..0.057 rows=1 loops=2)

10.          

Initplan (for Result)

11. 0.008 0.108 ↑ 1.0 1 2

Limit (cost=0.06..0.24 rows=1 width=4) (actual time=0.054..0.054 rows=1 loops=2)

12. 0.100 0.100 ↑ 309.0 1 2

Index Only Scan Backward using tb_as_posi_day_pk on tb_as_posi_day (cost=0.06..57.83 rows=309 width=4) (actual time=0.050..0.050 rows=1 loops=2)

  • Index Cond: ((id_contract = tb_as_portfolio.id_contract) AND (id_portfolio = tb_as_portfolio.id_portfolio) AND (dt_posi IS NOT NULL))
  • Heap Fetches: 4
Planning time : 0.742 ms
Execution time : 81.151 ms