explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cv8c

Settings
# exclusive inclusive rows x rows loops node
1. 4.992 950.408 ↓ 0.0 0 1

Limit (cost=103,849.06..103,870.70 rows=1 width=231) (actual time=950.408..950.408 rows=0 loops=1)

2. 0.000 945.416 ↓ 21.3 101,118 1

Nested Loop Left Join (cost=1,089.21..103,849.06 rows=4,750 width=231) (actual time=26.633..945.416 rows=101,118 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))
  • 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))
3. 41.965 217.428 ↓ 21.3 101,118 1

Hash Left Join (cost=1,088.79..70,826.97 rows=4,750 width=204) (actual time=26.285..217.428 rows=101,118 loops=1)

  • Hash Cond: ((tb_dist_certificate.id_contract = tb_dist_fund_selected.id_contract) AND (tb_dist_certificate.id_instrument = tb_dist_fund_selected.id_instrument))
4. 0.000 174.879 ↓ 21.3 101,118 1

Gather (cost=1,001.29..70,714.47 rows=4,750 width=175) (actual time=25.655..174.879 rows=101,118 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 25.801 317.098 ↓ 17.0 33,706 3 / 3

Nested Loop Left Join (cost=1.29..69,239.47 rows=1,979 width=175) (actual time=108.278..317.098 rows=33,706 loops=3)

6. 31.996 257.591 ↓ 17.0 33,706 3 / 3

Nested Loop (cost=0.99..68,584.06 rows=1,979 width=135) (actual time=108.258..257.591 rows=33,706 loops=3)

7. 23.533 69.495 ↓ 2.4 78,050 3 / 3

Nested Loop (cost=0.57..43,256.42 rows=33,088 width=101) (actual time=20.576..69.495 rows=78,050 loops=3)

8. 20.695 20.695 ↓ 1.3 253 3 / 3

Parallel Seq Scan on tb_dist_fund_daily (cost=0.00..11,304.70 rows=198 width=27) (actual time=19.143..20.695 rows=253 loops=3)

  • Filter: ((id_contract = 8) AND (dt_reference = 20,200,624))
  • Rows Removed by Filter: 182,564
9. 25.267 25.267 ↓ 1.9 309 758 / 3

Index Scan using tb_dist_certificate_daily_id_instrument_dt_reference_id_contrac on tb_dist_certificate_daily (cost=0.57..159.76 rows=161 width=82) (actual time=0.007..0.100 rows=309 loops=758)

  • Index Cond: ((id_instrument = tb_dist_fund_daily.id_instrument) AND (dt_reference = 20,200,624) AND (id_contract = 8))
10. 156.100 156.100 ↓ 0.0 0 234,150 / 3

Index Scan using tb_dist_certificate_pk on tb_dist_certificate (cost=0.43..0.77 rows=1 width=46) (actual time=0.002..0.002 rows=0 loops=234,150)

  • 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: 1
11. 33.706 33.706 ↑ 1.0 1 101,118 / 3

Index Scan using tb_core_customer_data_pk on tb_core_customer_data (cost=0.29..0.33 rows=1 width=44) (actual time=0.001..0.001 rows=1 loops=101,118)

  • Index Cond: ((tb_dist_certificate.id_contract = id_contract) AND (id_contract = 8) AND (tb_dist_certificate.id_customer = id_customer))
12. 0.201 0.584 ↓ 1.0 1,001 1

Hash (cost=72.50..72.50 rows=1,000 width=45) (actual time=0.583..0.584 rows=1,001 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 85kB
13. 0.383 0.383 ↓ 1.0 1,001 1

Seq Scan on tb_dist_fund_selected (cost=0.00..72.50 rows=1,000 width=45) (actual time=0.008..0.383 rows=1,001 loops=1)

  • Filter: (id_contract = 8)
14. 0.000 0.000 ↓ 0.0 0 101,118

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

15. 0.010 0.010 ↓ 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.010..0.010 rows=0 loops=1)

  • Index Cond: ((id_contract = 8) AND (dt_reference = 20,200,624))
16. 41.965 217.428 ↓ 21.3 101,118 1

Hash Left Join (cost=1,088.79..70,826.97 rows=4,750 width=204) (actual time=26.285..217.428 rows=101,118 loops=1)

  • Hash Cond: ((tb_dist_certificate.id_contract = tb_dist_fund_selected.id_contract) AND (tb_dist_certificate.id_instrument = tb_dist_fund_selected.id_instrument))
17. 0.000 174.879 ↓ 21.3 101,118 1

Gather (cost=1,001.29..70,714.47 rows=4,750 width=175) (actual time=25.655..174.879 rows=101,118 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
18. 25.801 317.098 ↓ 17.0 33,706 3 / 3

Nested Loop Left Join (cost=1.29..69,239.47 rows=1,979 width=175) (actual time=108.278..317.098 rows=33,706 loops=3)

19. 31.996 257.591 ↓ 17.0 33,706 3 / 3

Nested Loop (cost=0.99..68,584.06 rows=1,979 width=135) (actual time=108.258..257.591 rows=33,706 loops=3)

20. 23.533 69.495 ↓ 2.4 78,050 3 / 3

Nested Loop (cost=0.57..43,256.42 rows=33,088 width=101) (actual time=20.576..69.495 rows=78,050 loops=3)

21. 20.695 20.695 ↓ 1.3 253 3 / 3

Parallel Seq Scan on tb_dist_fund_daily (cost=0.00..11,304.70 rows=198 width=27) (actual time=19.143..20.695 rows=253 loops=3)

  • Filter: ((id_contract = 8) AND (dt_reference = 20,200,624))
  • Rows Removed by Filter: 182,564
22. 25.267 25.267 ↓ 1.9 309 758 / 3

Index Scan using tb_dist_certificate_daily_id_instrument_dt_reference_id_contrac on tb_dist_certificate_daily (cost=0.57..159.76 rows=161 width=82) (actual time=0.007..0.100 rows=309 loops=758)

  • Index Cond: ((id_instrument = tb_dist_fund_daily.id_instrument) AND (dt_reference = 20,200,624) AND (id_contract = 8))
23. 156.100 156.100 ↓ 0.0 0 234,150 / 3

Index Scan using tb_dist_certificate_pk on tb_dist_certificate (cost=0.43..0.77 rows=1 width=46) (actual time=0.002..0.002 rows=0 loops=234,150)

  • 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: 1
24. 33.706 33.706 ↑ 1.0 1 101,118 / 3

Index Scan using tb_core_customer_data_pk on tb_core_customer_data (cost=0.29..0.33 rows=1 width=44) (actual time=0.001..0.001 rows=1 loops=101,118)

  • Index Cond: ((tb_dist_certificate.id_contract = id_contract) AND (id_contract = 8) AND (tb_dist_certificate.id_customer = id_customer))
25. 0.201 0.584 ↓ 1.0 1,001 1

Hash (cost=72.50..72.50 rows=1,000 width=45) (actual time=0.583..0.584 rows=1,001 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 85kB
26. 0.383 0.383 ↓ 1.0 1,001 1

Seq Scan on tb_dist_fund_selected (cost=0.00..72.50 rows=1,000 width=45) (actual time=0.008..0.383 rows=1,001 loops=1)

  • Filter: (id_contract = 8)
27. 0.000 0.000 ↓ 0.0 0 101,118

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

28. 0.010 0.010 ↓ 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.010..0.010 rows=0 loops=1)

  • Index Cond: ((id_contract = 8) AND (dt_reference = 20,200,624))
29.          

SubPlan (for Nested Loop Left Join)

30. 404.472 606.708 ↑ 1.0 1 101,118

Nested Loop (cost=3.83..6.89 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=101,118)

31. 202.236 202.236 ↑ 1.0 1 101,118

Index Scan using tb_core_customer_broker_accounts_pk on tb_core_customer_broker_accounts (cost=0.42..2.46 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=101,118)

  • Index Cond: ((id_contract = tb_core_customer_data.id_contract) AND (id_customer = tb_core_customer_data.id_customer))
  • Filter: (((tb_dist_certificate.cd_account)::character varying)::text = (((vl_account_number)::text || ''::text) || (vl_account_digit)::text))
32. 202.236 606.708 ↑ 1.0 1 101,118

Nested Loop (cost=3.83..6.89 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=101,118)

33. 202.236 202.236 ↑ 1.0 1 101,118

Index Scan using tb_core_customer_broker_accounts_pk on tb_core_customer_broker_accounts (cost=0.42..2.46 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=101,118)

  • Index Cond: ((id_contract = tb_core_customer_data.id_contract) AND (id_customer = tb_core_customer_data.id_customer))
  • Filter: (((tb_dist_certificate.cd_account)::character varying)::text = (((vl_account_number)::text || ''::text) || (vl_account_digit)::text))
  • Rows Removed by Filter: 0
34. 0.000 202.236 ↑ 1.0 1 101,118

Bitmap Heap Scan on tb_core_broker_office (cost=3.41..4.43 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=101,118)

  • Recheck Cond: ((id_contract = tb_core_customer_data.id_contract) AND (id_office = tb_core_customer_broker_accounts.id_office))
  • Heap Blocks: exact=101,118
35. 202.236 202.236 ↓ 2.0 2 101,118

Bitmap Index Scan on tb_core_broker_office_pk (cost=0.00..3.41 rows=1 width=0) (actual time=0.002..0.002 rows=2 loops=101,118)

  • Index Cond: ((id_contract = tb_core_customer_data.id_contract) AND (id_office = tb_core_customer_broker_accounts.id_office))
Planning time : 29.925 ms
Execution time : 950.754 ms