explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kHyD

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 6.165 ↓ 0.0 0 1

Sort (cost=9,657.44..9,657.44 rows=1 width=128) (actual time=6.165..6.165 rows=0 loops=1)

  • Sort Key: aux.id_basket, aux.seq
  • Sort Method: quicksort Memory: 25kB
2.          

CTE aux

3. 0.007 6.088 ↑ 48.7 37 1

Nested Loop (cost=1.27..9,611.89 rows=1,802 width=62) (actual time=0.599..6.088 rows=37 loops=1)

4. 0.040 5.896 ↑ 48.7 37 1

Nested Loop (cost=0.84..5,229.46 rows=1,802 width=54) (actual time=0.588..5.896 rows=37 loops=1)

5. 5.745 5.745 ↑ 48.7 37 1

Index Scan using tb_operation_bonds_id_broker_account_cblc_cd_side_dt_pre_se_idx on tb_operation_bonds (cost=0.41..1,365.08 rows=1,802 width=37) (actual time=0.562..5.745 rows=37 loops=1)

  • Index Cond: ((id_broker = '13'::smallint) AND (cd_side = 'B'::bpchar) AND (dt_pre_settl_money IS NULL) AND (dt_settl_money IS NULL))
  • Filter: (dt_settl_custody IS NULL)
6. 0.111 0.111 ↑ 1.0 1 37

Index Scan using tb_instrument_pk on tb_instrument (cost=0.42..2.14 rows=1 width=33) (actual time=0.003..0.003 rows=1 loops=37)

  • Index Cond: (id_instrument = tb_operation_bonds.id_instrument)
7. 0.185 0.185 ↑ 1.0 1 37

Index Scan using tb_operation_id_operation_idx on tb_operation (cost=0.43..2.42 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=37)

  • Index Cond: (id_operation = tb_operation_bonds.id_operation)
8. 0.000 6.158 ↓ 0.0 0 1

Nested Loop (cost=0.84..45.54 rows=1 width=128) (actual time=6.158..6.158 rows=0 loops=1)

9. 0.010 6.158 ↓ 0.0 0 1

Nested Loop (cost=0.42..43.10 rows=1 width=128) (actual time=6.158..6.158 rows=0 loops=1)

  • Join Filter: (aux.id_investor = tb_investor_broker_account.id_investor)
  • Rows Removed by Join Filter: 37
10. 0.017 0.017 ↑ 1.0 1 1

Index Scan using tb_investor_broker_account_idx0 on tb_investor_broker_account (cost=0.42..2.44 rows=1 width=16) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: ((id_broker = 13) AND (account_number = '9999316'::bigint))
  • Filter: (id_contract = 8)
11. 6.131 6.131 ↓ 4.1 37 1

CTE Scan on aux (cost=0.00..40.55 rows=9 width=120) (actual time=0.603..6.131 rows=37 loops=1)

  • Filter: (id_broker = 13)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_oms_account_pk on tb_oms_account (cost=0.42..2.44 rows=1 width=13) (never executed)

  • Index Cond: ((id_broker = 13) AND ((account)::text = ((tb_investor_broker_account.account_number)::character varying)::text))