explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AUTo

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 246.610 ↓ 1,000.0 1,000 1

Nested Loop Left Join (cost=145,488.29..145,498.49 rows=1 width=443) (actual time=232.300..246.610 rows=1,000 loops=1)

2.          

CTE certificates

3. 0.000 232.527 ↓ 1,000.0 1,000 1

Limit (cost=145,478.45..145,486.18 rows=1 width=150) (actual time=232.177..232.527 rows=1,000 loops=1)

4. 23.237 234.174 ↓ 6.1 91,000 1

Gather (cost=29,424.07..145,478.45 rows=15,015 width=150) (actual time=114.108..234.174 rows=91,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 80.301 210.937 ↓ 4.9 30,543 3 / 3

Parallel Hash Join (cost=28,424.07..142,976.95 rows=6,256 width=150) (actual time=110.914..210.937 rows=30,543 loops=3)

  • Hash Cond: ((tb_dist_certificate_daily.id_customer = tb_dist_certificate.id_customer) AND (tb_dist_certificate_daily.id_instrument = tb_dist_certificate.id_instrument) AND (tb_dist_certificate_daily.id_certificate = tb_dist_certificate.id_certificate))
6. 20.616 20.616 ↑ 1.4 74,646 3 / 3

Parallel Index Scan using tb_dist_certificate_daily_id_contract_dt_reference_idx on tb_dist_certificate_daily (cost=0.57..113,488.33 rows=105,462 width=82) (actual time=0.031..20.616 rows=74,646 loops=3)

  • Index Cond: ((id_contract = 8) AND (dt_reference = 20,200,601))
7. 32.725 110.020 ↑ 1.3 83,182 3 / 3

Parallel Hash (cost=26,599.46..26,599.46 rows=104,231 width=46) (actual time=110.019..110.020 rows=83,182 loops=3)

  • Buckets: 262,144 Batches: 1 Memory Usage: 23,488kB
8. 77.295 77.295 ↑ 1.3 83,182 3 / 3

Parallel Seq Scan on tb_dist_certificate (cost=0.00..26,599.46 rows=104,231 width=46) (actual time=0.007..77.295 rows=83,182 loops=3)

  • Filter: ((NOT is_from_minicom) AND (id_contract = 8))
  • Rows Removed by Filter: 362,352
9. 0.731 243.619 ↓ 1,000.0 1,000 1

Nested Loop (cost=1.69..9.85 rows=1 width=440) (actual time=232.285..243.619 rows=1,000 loops=1)

10. 0.796 241.888 ↓ 1,000.0 1,000 1

Nested Loop (cost=1.26..7.40 rows=1 width=433) (actual time=232.269..241.888 rows=1,000 loops=1)

  • Join Filter: (certificates.id_contract = tb_core_broker_office.id_contract)
11. 0.138 240.092 ↓ 1,000.0 1,000 1

Nested Loop (cost=0.98..7.08 rows=1 width=429) (actual time=232.256..240.092 rows=1,000 loops=1)

12. 0.640 236.954 ↓ 1,000.0 1,000 1

Nested Loop Left Join (cost=0.57..4.63 rows=1 width=431) (actual time=232.215..236.954 rows=1,000 loops=1)

13. 0.601 234.314 ↓ 1,000.0 1,000 1

Nested Loop Left Join (cost=0.28..2.32 rows=1 width=395) (actual time=232.202..234.314 rows=1,000 loops=1)

14. 232.713 232.713 ↓ 1,000.0 1,000 1

CTE Scan on certificates (cost=0.00..0.02 rows=1 width=362) (actual time=232.180..232.713 rows=1,000 loops=1)

15. 1.000 1.000 ↑ 1.0 1 1,000

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

  • Index Cond: ((certificates.id_contract = id_contract) AND (certificates.id_instrument = id_instrument))
16. 2.000 2.000 ↑ 1.0 1 1,000

Index Scan using tb_core_customer_data_pk on tb_core_customer_data (cost=0.29..2.31 rows=1 width=44) (actual time=0.002..0.002 rows=1 loops=1,000)

  • Index Cond: ((certificates.id_contract = id_contract) AND (certificates.id_customer = id_customer))
17. 3.000 3.000 ↑ 1.0 1 1,000

Index Scan using tb_core_customer_broker_accounts_con_uk on tb_core_customer_broker_accounts (cost=0.42..2.44 rows=1 width=18) (actual time=0.003..0.003 rows=1 loops=1,000)

  • Index Cond: ((id_contract = certificates.id_contract) AND (vl_account_number = certificates.vl_account_number))
  • Filter: (certificates.vl_account_digit = vl_account_digit)
18. 1.000 1.000 ↑ 1.0 1 1,000

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

  • Index Cond: ((id_contract = tb_core_customer_broker_accounts.id_contract) AND (id_office = tb_core_customer_broker_accounts.id_office))
19. 1.000 1.000 ↑ 1.0 1 1,000

Index Scan using tb_dist_fund_daily_search_idx on tb_dist_fund_daily (cost=0.42..2.45 rows=1 width=27) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: ((dt_reference = certificates.dt_reference) AND (id_instrument = certificates.id_instrument))
  • Filter: (certificates.id_contract = id_contract)
20. 3.000 3.000 ↓ 0.0 0 1,000

Index Scan using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed (cost=0.42..2.45 rows=1 width=26) (actual time=0.003..0.003 rows=0 loops=1,000)

  • Index Cond: ((certificates.id_customer = id_customer) AND (certificates.id_instrument = id_instrument) AND (certificates.id_certificate = id_certificate))
  • Filter: ((certificates.id_contract = id_contract) AND (certificates.dt_reference = dt_reference))
  • Rows Removed by Filter: 1