explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5ZTR

Settings
# exclusive inclusive rows x rows loops node
1. 0.090 18.976 ↑ 1.0 1,000 1

Limit (cost=27.28..24,893.20 rows=1,000 width=231) (actual time=0.180..18.976 rows=1,000 loops=1)

2. 1.486 18.886 ↑ 19.1 1,001 1

Nested Loop (cost=2.41..474,866.88 rows=19,097 width=231) (actual time=0.110..18.886 rows=1,001 loops=1)

3. 0.344 10.393 ↑ 14.9 1,001 1

Nested Loop Left Join (cost=1.98..388,135.06 rows=14,895 width=191) (actual time=0.059..10.393 rows=1,001 loops=1)

  • Join Filter: ((tb_dist_certificate_daily.id_contract = tb_dist_certificate_quote_erosion_executed.id_contract) AND (tb_dist_certificate_daily.dt_reference = tb_dist_certificate_quote_erosion_executed.dt_reference) AND (tb_dist_certificate_daily.id_customer = tb_dist_certificate_quote_erosion_executed.id_customer) AND (tb_dist_certificate_daily.id_instrument = tb_dist_certificate_quote_erosion_executed.id_instrument) AND (tb_dist_certificate_daily.id_certificate = tb_dist_certificate_quote_erosion_executed.id_certificate))
4. 0.209 10.049 ↑ 14.9 1,001 1

Nested Loop Left Join (cost=1.56..387,387.41 rows=14,895 width=193) (actual time=0.050..10.049 rows=1,001 loops=1)

5. 0.562 6.837 ↑ 14.9 1,001 1

Nested Loop Left Join (cost=1.27..374,998.32 rows=14,895 width=157) (actual time=0.042..6.837 rows=1,001 loops=1)

6. 0.335 5.274 ↑ 14.9 1,001 1

Nested Loop (cost=0.99..363,934.86 rows=14,895 width=120) (actual time=0.035..5.274 rows=1,001 loops=1)

7. 0.911 0.911 ↑ 246.6 1,007 1

Index Scan using tb_dist_certificate_daily_id_contract_dt_reference_idx on tb_dist_certificate_daily (cost=0.57..112,861.89 rows=248,285 width=82) (actual time=0.019..0.911 rows=1,007 loops=1)

  • Index Cond: ((id_contract = 8) AND (dt_reference = 20,200,603))
8. 4.028 4.028 ↑ 1.0 1 1,007

Index Scan using tb_dist_certificate_pk on tb_dist_certificate (cost=0.43..1.01 rows=1 width=46) (actual time=0.004..0.004 rows=1 loops=1,007)

  • Index Cond: ((id_customer = tb_dist_certificate_daily.id_customer) AND (id_instrument = tb_dist_certificate_daily.id_instrument) AND (id_contract = 8) AND (id_certificate = tb_dist_certificate_daily.id_certificate))
  • Filter: (NOT is_from_minicom)
  • Rows Removed by Filter: 0
9. 1.001 1.001 ↑ 1.0 1 1,001

Index Scan using tb_dist_fund_selected_pk on tb_dist_fund_selected (cost=0.28..0.74 rows=1 width=45) (actual time=0.001..0.001 rows=1 loops=1,001)

  • Index Cond: ((tb_dist_certificate.id_contract = id_contract) AND (id_contract = 8) AND (tb_dist_certificate.id_instrument = id_instrument))
10. 3.003 3.003 ↑ 1.0 1 1,001

Index Scan using tb_core_customer_data_pk on tb_core_customer_data (cost=0.29..0.83 rows=1 width=44) (actual time=0.003..0.003 rows=1 loops=1,001)

  • Index Cond: ((tb_dist_certificate.id_contract = id_contract) AND (id_contract = 8) AND (tb_dist_certificate.id_customer = id_customer))
11. 0.000 0.000 ↓ 0.0 0 1,001

Materialize (cost=0.42..2.91 rows=2 width=26) (actual time=0.000..0.000 rows=0 loops=1,001)

12. 0.006 0.006 ↓ 0.0 0 1

Index Scan using tb_dist_certificate_quote_erosion_executed_idx1 on tb_dist_certificate_quote_erosion_executed (cost=0.42..2.90 rows=2 width=26) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((id_contract = 8) AND (dt_reference = 20,200,603))
13. 2.002 2.002 ↑ 1.0 1 1,001

Index Scan using tb_dist_fund_daily_pk on tb_dist_fund_daily (cost=0.42..0.98 rows=1 width=27) (actual time=0.002..0.002 rows=1 loops=1,001)

  • Index Cond: ((id_contract = 8) AND (id_instrument = tb_dist_certificate_daily.id_instrument) AND (dt_reference = 20,200,603))
14.          

SubPlan (for Nested Loop)

15. 2.002 5.005 ↑ 1.0 1 1,001

Nested Loop (cost=0.72..3.77 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1,001)

16. 2.002 2.002 ↑ 1.0 1 1,001

Index Only Scan using tb_core_customer_broker_accounts_digit on tb_core_customer_broker_accounts (cost=0.44..1.47 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,001)

  • Index Cond: ((vl_account_number = (ceiling(((tb_dist_certificate.cd_account / 10))::double precision))::bigint) AND (vl_account_digit = ("right"(btrim(((tb_dist_certificate.cd_account)::character varying)::text), 1))::smallint) AND (id_customer = tb_core_customer_data.id_customer) AND (id_contract = tb_core_customer_data.id_contract))
  • Heap Fetches: 0
17. 1.001 1.001 ↑ 1.0 1 1,001

Index Scan using tb_core_broker_office_pk on tb_core_broker_office (cost=0.28..2.30 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=1,001)

  • Index Cond: ((id_contract = tb_core_customer_data.id_contract) AND (id_office = tb_core_customer_broker_accounts.id_office))