explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hbQNc

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 2.890 ↓ 0.0 10 1

(cost=520.80..5859.87 rows=10 width=205) (cost=0..0 rows=0 width=0) (actual time=0.186..2.890 rows=10 loops=1)

2. 0.077 2.885 ↑ 67.7 10 1

Nested Loop Left Join (cost=520.80..361,975.97 rows=677 width=205) (actual time=0.184..2.885 rows=10 loops=1)

  • Join Filter: ((tb_bond_operation.id_contract = tb_bond_issuer.id_contract) AND (tb_bond_operation.id_issuer = tb_bond_issuer.id_issuer))
  • Rows Removed by Join Filter: 230
3. 0.018 2.758 ↑ 67.7 10 1

Nested Loop Left Join (cost=520.80..361,663.16 rows=677 width=193) (actual time=0.152..2.758 rows=10 loops=1)

4. 0.014 2.580 ↑ 67.7 10 1

Nested Loop Left Join (cost=520.38..358,789.77 rows=677 width=169) (actual time=0.121..2.580 rows=10 loops=1)

5. 0.343 2.506 ↑ 67.7 10 1

Nested Loop Left Join (cost=520.23..358,653.61 rows=677 width=154) (actual time=0.110..2.506 rows=10 loops=1)

6. 1.938 2.133 ↑ 67.7 10 1

Nested Loop Left Join (cost=0.98..6,340.13 rows=677 width=137) (actual time=0.102..2.133 rows=10 loops=1)

  • -> Index Scan using tb_bond_custody_external_instrument_id_contract_id_instrument_i on tb_bond_custody_external_instrument custody_external_instrument (cost=0.56..8.46 rows=1 width=20) (actual time=0.060..0.19
7. 0.015 0.195 ↑ 67.7 10 1

Nested Loop (cost=0.42..603.98 rows=677 width=133) (actual time=0.098..0.195 rows=10 loops=1)

  • Index Cond: ((tb_bond_operation.id_contract = id_contract) AND (id_contract = 39) AND (tb_bond_operation.id_instrument = id_instrument))
8. 0.030 0.130 ↑ 67.7 10 1

Nested Loop (cost=0.28..484.20 rows=677 width=91) (actual time=0.082..0.130 rows=10 loops=1)

  • Join Filter: ((tb_bond_operation.side)::text = (dm_side_operation.cd_side_operation)::text)
  • Rows Removed by Join Filter: 27
9. 0.050 0.050 ↑ 270.9 10 1

Index Scan Backward using tb_bond_operation_pk on tb_bond_operation (cost=0.28..442.51 rows=2,709 width=59) (actual time=0.036..0.050 rows=10 loops=1)

  • Index Cond: (id_contract = 39)
10. 0.031 0.050 ↓ 4.0 4 10

Materialize (cost=0.00..1.05 rows=1 width=68) (actual time=0.004..0.005 rows=4 loops=10)

11. 0.019 0.019 ↓ 4.0 4 1

Seq Scan on dm_side_operation (cost=0.00..1.05 rows=1 width=68) (actual time=0.017..0.019 rows=4 loops=1)

  • Filter: (id_contract = 39)
12. 0.050 0.050 ↑ 1.0 1 10

Index Scan using tb_bond_operation_status_pk on tb_bond_operation_status (cost=0.14..0.17 rows=1 width=50) (actual time=0.004..0.005 rows=1 loops=10)

  • Index Cond: ((id_contract = 39) AND (id_status = tb_bond_operation.id_status))
13. 0.000 0.030 ↓ 0.0 0 10

Index Scan using tb_bond_custody_external_dt_reference_id_operation_external_idx on tb_bond_custody_external custody_external (cost=519.25..520.39 rows=1 width=45) (actual time=0.003..0.003 rows=0 loops=10)

  • Index Cond: ((dt_reference = (SubPlan 1)) AND (id_operation_external = custody_external_instrument.id_operation_external))
  • Filter: ((id_contract = 39) AND (id_contract = custody_external_instrument.id_contract))
14.          

SubPlan (for Index Scan)

15. 0.310 0.310 ↑ 1.0 1 10

Aggregate (cost=518.69..518.70 rows=1 width=4) (actual time=0.031..0.031 rows=1 loops=10)

  • -> Index Scan using tb_bond_custody_external_id_operation_external_idx on tb_bond_custody_external custody_external_dt_reference (cost=0.43..518.29 rows=160 width=4) (actual time=0.003..0.029 rows=7 lo
  • Index Cond: (id_operation_external = custody_external_instrument.id_operation_external)
  • Filter: (id_contract = custody_external_instrument.id_contract)
16. 0.060 0.060 ↑ 1.0 1 10

Index Scan using tb_bond_title_pk on tb_bond_title (cost=0.14..0.19 rows=1 width=23) (actual time=0.005..0.006 rows=1 loops=10)

  • Index Cond: ((tb_bond_operation.id_contract = id_contract) AND (id_contract = 39) AND (tb_bond_operation.id_bond = id_bond))
17. 0.160 0.160 ↑ 1.0 1 10

Index Scan using tb_core_customer_data_pk on tb_core_customer_data (cost=0.42..4.23 rows=1 width=36) (actual time=0.015..0.016 rows=1 loops=10)

  • Index Cond: ((tb_bond_operation.id_contract = id_contract) AND (id_contract = 39) AND (tb_bond_operation.id_customer = id_customer))
18. 0.031 0.050 ↑ 1.1 24 10

Materialize (cost=0.00..1.46 rows=26 width=22) (actual time=0.002..0.005 rows=24 loops=10)

19. 0.019 0.019 ↑ 1.0 26 1

Seq Scan on tb_bond_issuer (cost=0.00..1.32 rows=26 width=22) (actual time=0.011..0.019 rows=26 loops=1)

  • Filter: (id_contract = 39)