explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iV1b

Settings
# exclusive inclusive rows x rows loops node
1. 0.056 279.545 ↓ 1,000.0 1,000 1

Nested Loop Left Join (cost=145,488.29..145,498.47 rows=1 width=443) (actual time=256.840..279.545 rows=1,000 loops=1)

2.          

CTE certificates

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

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

4. 24.205 259.051 ↓ 6.1 91,000 1

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

  • Workers Planned: 2
  • Workers Launched: 2
5. 87.744 234.846 ↓ 4.9 30,520 3 / 3

Parallel Hash Join (cost=28,424.07..142,976.95 rows=6,256 width=150) (actual time=124.878..234.846 rows=30,520 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. 23.159 23.159 ↑ 1.4 74,623 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.036..23.159 rows=74,623 loops=3)

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

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

  • Buckets: 262,144 Batches: 1 Memory Usage: 23,456kB
8. 87.290 87.290 ↑ 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.011..87.290 rows=83,182 loops=3)

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

Nested Loop (cost=1.69..9.84 rows=1 width=440) (actual time=256.824..270.489 rows=1,000 loops=1)

10. 0.812 268.663 ↓ 1,000.0 1,000 1

Nested Loop (cost=1.26..7.38 rows=1 width=425) (actual time=256.810..268.663 rows=1,000 loops=1)

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

Nested Loop (cost=0.98..7.07 rows=1 width=429) (actual time=256.793..266.851 rows=1,000 loops=1)

12. 0.823 261.816 ↓ 1,000.0 1,000 1

Nested Loop Left Join (cost=0.57..4.63 rows=1 width=429) (actual time=256.777..261.816 rows=1,000 loops=1)

13. 0.688 258.993 ↓ 1,000.0 1,000 1

Nested Loop Left Join (cost=0.28..2.32 rows=1 width=393) (actual time=256.764..258.993 rows=1,000 loops=1)

14. 257.305 257.305 ↓ 1,000.0 1,000 1

CTE Scan on certificates (cost=0.00..0.02 rows=1 width=360) (actual time=256.740..257.305 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. 4.000 4.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=16) (actual time=0.004..0.004 rows=1 loops=1,000)

  • Index Cond: ((id_contract = certificates.id_contract) AND (vl_account_number = certificates.vl_account_number))
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.44 rows=1 width=23) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: ((dt_reference = certificates.dt_reference) AND (id_instrument = certificates.id_instrument))
20. 9.000 9.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.009..0.009 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