explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ajOL

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

Nested Loop Left Join (cost=145,487.59..145,499.46 rows=1 width=443) (actual time=248.632..262.136 rows=1,000 loops=1)

2.          

CTE certificates

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

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

4. 22.756 250.487 ↓ 6.1 91,000 1

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

  • Workers Planned: 2
  • Workers Launched: 2
5. 81.886 227.731 ↓ 4.9 30,539 3 / 3

Parallel Hash Join (cost=28,424.07..142,976.95 rows=6,256 width=150) (actual time=124.800..227.731 rows=30,539 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. 21.873 21.873 ↑ 1.4 74,643 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..21.873 rows=74,643 loops=3)

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

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

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

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

Nested Loop (cost=0.99..7.09 rows=1 width=446) (actual time=248.572..255.147 rows=1,000 loops=1)

10. 0.723 253.409 ↓ 1,000.0 1,000 1

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

11. 0.549 250.686 ↓ 1,000.0 1,000 1

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

12. 249.137 249.137 ↓ 1,000.0 1,000 1

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

13. 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))
14. 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))
15. 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)
16. 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
17.          

SubPlan (for Nested Loop Left Join)

18. 1.000 4.000 ↑ 1.0 1 1,000

Nested Loop (cost=0.70..3.74 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1,000)

19. 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=8) (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
20. 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..2.30 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=1,000)

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