explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7H0p

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.005 194.504 ↑ 1.0 1 1

Limit (cost=6,519.40..6,519.41 rows=1 width=61) (actual time=194.500..194.504 rows=1 loops=1)

2. 0.317 194.499 ↑ 1.0 1 1

Sort (cost=6,519.40..6,519.41 rows=1 width=61) (actual time=194.499..194.499 rows=1 loops=1)

  • Sort Key: tb_bond_custody_external.dt_reference DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 0.475 194.182 ↓ 554.0 554 1

Nested Loop Left Join (cost=1.14..6,519.39 rows=1 width=61) (actual time=35.220..194.182 rows=554 loops=1)

4. 0.156 45.789 ↓ 554.0 554 1

Nested Loop (cost=0.85..6,443.92 rows=1 width=34) (actual time=34.677..45.789 rows=554 loops=1)

  • Join Filter: (tb_bond_custody_external.id_customer = tb_core_customer_broker_accounts.id_customer)
5. 7.071 7.071 ↑ 1.0 1 1

Index Only Scan using tb_core_customer_broker_accounts_pk on tb_core_customer_broker_accounts (cost=0.42..1,967.88 rows=1 width=4) (actual time=2.471..7.071 rows=1 loops=1)

  • Index Cond: (vl_account_number = '743071'::bigint)
  • Heap Fetches: 0
6. 0.320 38.562 ↓ 3.1 554 1

Nested Loop (cost=0.44..4,473.82 rows=178 width=38) (actual time=32.203..38.562 rows=554 loops=1)

7. 33.767 33.767 ↑ 1.0 1 1

Seq Scan on tb_bond_custody_external_instrument (cost=0.00..3,080.25 rows=1 width=8) (actual time=32.131..33.767 rows=1 loops=1)

  • Filter: (id_instrument = '791130'::bigint)
  • Rows Removed by Filter: 115034
8. 4.475 4.475 ↓ 1.5 554 1

Index Scan using tb_bond_custody_external_id_operation_external_idx on tb_bond_custody_external (cost=0.44..1,389.80 rows=377 width=46) (actual time=0.065..4.475 rows=554 loops=1)

  • Index Cond: (id_operation_external = tb_bond_custody_external_instrument.id_operation_external)
9. 147.918 147.918 ↑ 1.0 1 554

Index Scan using tb_bond_stock_external_id_contract_numero_estoque_idx on tb_bond_stock_external (cost=0.29..75.46 rows=1 width=37) (actual time=0.257..0.267 rows=1 loops=554)

  • Index Cond: ((numero_estoque)::text = (tb_bond_custody_external.id_estoque_external)::text)
Planning time : 3.766 ms
Execution time : 194.625 ms