explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nnswn

Settings
# exclusive inclusive rows x rows loops node
1. 0.928 239.889 ↓ 1,000.0 1,000 1

Nested Loop Left Join (cost=145,488.29..145,497.48 rows=1 width=443) (actual time=225.043..239.889 rows=1,000 loops=1)

2.          

CTE certificates

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

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

4. 22.948 226.893 ↓ 6.1 91,000 1

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

  • Workers Planned: 2
  • Workers Launched: 2
5. 76.324 203.945 ↓ 4.9 30,542 3 / 3

Parallel Hash Join (cost=28,424.07..142,976.95 rows=6,256 width=150) (actual time=108.001..203.945 rows=30,542 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.492 20.492 ↑ 1.4 74,645 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.028..20.492 rows=74,645 loops=3)

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

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

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

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

Nested Loop (cost=1.69..8.84 rows=1 width=440) (actual time=225.019..235.961 rows=1,000 loops=1)

10. 0.791 234.137 ↓ 1,000.0 1,000 1

Nested Loop (cost=1.26..6.39 rows=1 width=433) (actual time=225.001..234.137 rows=1,000 loops=1)

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

Nested Loop (cost=0.98..6.07 rows=1 width=429) (actual time=224.983..232.346 rows=1,000 loops=1)

12. 0.727 229.970 ↓ 1,000.0 1,000 1

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

13. 0.651 227.243 ↓ 1,000.0 1,000 1

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

14. 225.592 225.592 ↓ 1,000.0 1,000 1

CTE Scan on certificates (cost=0.00..0.02 rows=1 width=362) (actual time=224.899..225.592 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. 2.000 2.000 ↑ 1.0 1 1,000

Index Only Scan using tb_core_customer_broker_accounts_digit on tb_core_customer_broker_accounts (cost=0.42..1.44 rows=1 width=18) (actual time=0.002..0.002 rows=1 loops=1,000)

  • Index Cond: ((vl_account_number = certificates.vl_account_number) AND (vl_account_digit = certificates.vl_account_digit) AND (id_contract = certificates.id_contract))
  • Heap Fetches: 0
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