explain.depesz.com

PostgreSQL's explain analyze made readable

Result: utwU

Settings
# exclusive inclusive rows x rows loops node
1. 0.763 1,378.505 ↑ 1.0 1,000 1

Limit (cost=142,294.98..153,053.26 rows=1,000 width=231) (actual time=1,368.144..1,378.505 rows=1,000 loops=1)

2. 23.905 1,377.742 ↑ 1.8 11,000 1

Hash Join (cost=34,712.11..243,820.93 rows=19,437 width=231) (actual time=439.180..1,377.742 rows=11,000 loops=1)

  • Hash Cond: (tb_dist_certificate_daily.id_instrument = tb_dist_fund_daily.id_instrument)
3. 6.159 781.287 ↑ 1.4 11,000 1

Nested Loop Left Join (cost=34,311.25..150,620.28 rows=15,015 width=191) (actual time=368.569..781.287 rows=11,000 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. 1.360 775.128 ↑ 1.4 11,000 1

Hash Left Join (cost=34,310.83..150,242.46 rows=15,015 width=193) (actual time=366.916..775.128 rows=11,000 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))
5. 0.000 769.889 ↑ 1.4 11,000 1

Gather (cost=34,226.69..150,079.30 rows=15,015 width=160) (actual time=363.013..769.889 rows=11,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 4.273 1,084.530 ↑ 1.7 3,748 3 / 3

Parallel Hash Left Join (cost=33,226.69..147,577.80 rows=6,256 width=160) (actual time=359.267..1,084.530 rows=3,748 loops=3)

  • Hash Cond: ((tb_dist_certificate.id_contract = tb_core_customer_data.id_contract) AND (tb_dist_certificate.id_customer = tb_core_customer_data.id_customer))
7. 29.336 1,016.835 ↑ 1.7 3,748 3 / 3

Parallel Hash Join (cost=28,424.07..142,742.35 rows=6,256 width=120) (actual time=295.371..1,016.835 rows=3,748 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))
8. 696.054 696.054 ↑ 2.2 47,851 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=3.335..696.054 rows=47,851 loops=3)

  • Index Cond: ((id_contract = 8) AND (dt_reference = 20,200,601))
9. 39.786 291.445 ↑ 1.3 83,182 3 / 3

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

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

  • Filter: ((NOT is_from_minicom) AND (id_contract = 8))
  • Rows Removed by Filter: 362,352
11. 14.643 63.422 ↑ 1.3 30,883 3 / 3

Parallel Hash (cost=4,223.55..4,223.55 rows=38,604 width=44) (actual time=63.422..63.422 rows=30,883 loops=3)

  • Buckets: 131,072 Batches: 1 Memory Usage: 8,864kB
12. 48.779 48.779 ↑ 1.3 30,883 3 / 3

Parallel Seq Scan on tb_core_customer_data (cost=0.00..4,223.55 rows=38,604 width=44) (actual time=0.206..48.779 rows=30,883 loops=3)

  • Filter: (id_contract = 8)
13. 0.222 3.879 ↑ 1.0 987 1

Hash (cost=69.34..69.34 rows=987 width=45) (actual time=3.878..3.879 rows=987 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 84kB
14. 3.657 3.657 ↑ 1.0 987 1

Seq Scan on tb_dist_fund_selected (cost=0.00..69.34 rows=987 width=45) (actual time=0.858..3.657 rows=987 loops=1)

  • Filter: (id_contract = 8)
15. 0.000 0.000 ↓ 0.0 0 11,000

Materialize (cost=0.42..2.45 rows=1 width=26) (actual time=0.000..0.000 rows=0 loops=11,000)

16. 1.645 1.645 ↓ 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.44 rows=1 width=26) (actual time=1.645..1.645 rows=0 loops=1)

  • Index Cond: ((id_contract = 8) AND (dt_reference = 20,200,601))
17. 0.346 66.550 ↑ 1.1 752 1

Hash (cost=390.95..390.95 rows=793 width=27) (actual time=66.550..66.550 rows=752 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 53kB
18. 66.204 66.204 ↑ 1.1 752 1

Index Scan using tb_dist_fund_daily_search_idx on tb_dist_fund_daily (cost=0.42..390.95 rows=793 width=27) (actual time=1.177..66.204 rows=752 loops=1)

  • Index Cond: (dt_reference = 20,200,601)
  • Filter: (id_contract = 8)
19.          

SubPlan (for Hash Join)

20. 22.000 506.000 ↑ 1.0 1 11,000

Nested Loop (cost=0.70..4.76 rows=1 width=4) (actual time=0.043..0.046 rows=1 loops=11,000)

21. 429.000 429.000 ↑ 1.0 1 11,000

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.037..0.039 rows=1 loops=11,000)

  • 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
22. 55.000 55.000 ↑ 1.0 1 11,000

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.005..0.005 rows=1 loops=11,000)

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