explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7psk

Settings
# exclusive inclusive rows x rows loops node
1. 205.429 9,954.088 ↑ 16.1 53,217 1

Planning time: 26.371 msGather (cost=44,449.45..751,457.19 rows=857,500 width=7,051) (actual time=1,226.879..9,954.088 rows=53,217 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 27.985 9,748.659 ↑ 20.1 17,739 3 / 3

Hash Left Join (cost=44,439.45..665,697.19 rows=357,292 width=7,051) (actual time=1,206.746..9,748.659 rows=17,739 loops=3)

  • Hash Cond: (d.data_source_id = ds.data_source_id)
3. 9,718.862 9,718.862 ↑ 20.1 17,739 3 / 3

Nested Loop Left Join (cost=44,426.85..660,771.83 rows=357,292 width=5,786) (actual time=1,204.878..9,718.862 rows=17,739 loops=3)

4. 0.000 1.812 ↑ 1.0 266 3 / 3

Hash (cost=9.27..9.27 rows=266 width=1,265) (actual time=1.812..1.812 rows=266 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 239kB
5. 230.607 230.607 ↓ 0.0 0 53,217 / 3

Index Scan using deals_pkey on deals d (cost=0.43..0.46 rows=1 width=2,645) (actual time=0.013..0.013 rows=0 loops=53,217)

6. 1.504 1.504 ↑ 1.0 266 3 / 3

Index Scan using data_sources_pkey on data_sources ds (cost=0.15..9.27 rows=266 width=1,265) (actual time=0.037..1.504 rows=266 loops=3)

7. 58.515 9,458.491 ↑ 20.1 17,739 3 / 3

Hash Left Join (cost=44,426.42..494,365.53 rows=357,292 width=3,141) (actual time=1,204.839..9,458.491 rows=17,739 loops=3)

  • Index Cond: (rt.deal_id = deal_id)
  • Hash Cond: (car.relationship_id = rt.relationship_id)
8. 8,255.151 8,255.151 ↑ 20.7 17,279 3 / 3

Nested Loop Left Join (cost=1,026.08..433,607.69 rows=357,292 width=2,838) (actual time=50.682..8,255.151 rows=17,279 loops=3)

9. 0.000 1,144.825 ↑ 1.1 1,531,446 3 / 3

Hash (cost=21,931.82..21,931.82 rows=1,717,482 width=303) (actual time=1,144.825..1,144.825 rows=1,531,446 loops=3)

  • Buckets: 2097152 Batches: 1 Memory Usage: 207775kB
10. 552.666 552.666 ↑ 1.1 1,531,446 3 / 3

Seq Scan on referral_transactions rt (cost=0.00..21,931.82 rows=1,717,482 width=303) (actual time=0.025..552.666 rows=1,531,446 loops=3)

11. 3,475.083 3,475.083 ↑ 20.7 17,279 3 / 3

Nested Loop Left Join (cost=1,025.51..218,019.05 rows=357,292 width=2,425) (actual time=50.509..3,475.083 rows=17,279 loops=3)

12. 1,298.907 4,751.725 ↑ 1.0 1 51,837 / 3

Index Scan using logins_person_id_key on logins l (cost=0.56..0.59 rows=1 width=413) (actual time=0.273..0.275 rows=1 loops=51,837)

  • Index Cond: (p.participant_id = person_id)
13. 2,937.430 2,937.430 ↑ 1.0 1 51,837 / 3

Index Scan using persons_pkey on persons p (cost=0.44..0.48 rows=1 width=803) (actual time=0.168..0.170 rows=1 loops=51,837)

14. 145.968 515.388 ↑ 20.7 17,279 3 / 3

Hash Join (cost=1,025.08..42,569.29 rows=357,292 width=1,622) (actual time=50.386..515.388 rows=17,279 loops=3)

  • Index Cond: (car.customer_id = participant_id)
  • Hash Cond: (car.agent_id = a.agent_id)
15. 319.556 319.556 ↑ 1.3 552,761 3 / 3

Parallel Seq Scan on customer_agent_relationships car (cost=0.00..35,358.12 rows=696,848 width=247) (actual time=0.022..319.556 rows=552,761 loops=3)

16. 21.617 49.864 ↑ 1.1 11,854 3 / 3

Hash (cost=858.11..858.11 rows=13,357 width=1,375) (actual time=49.864..49.864 rows=11,854 loops=3)

  • Rows Removed by Filter: 1029158
  • Filter: (stop_date IS NULL)
  • Buckets: 16384 Batches: 1 Memory Usage: 11441kB
17. 28.247 28.247 ↑ 1.1 11,854 3 / 3

Index Scan using agents_agent_type_idx on agents a (cost=0.41..858.11 rows=13,357 width=1,375) (actual time=0.051..28.247 rows=11,854 loops=3)

  • Index Cond: (agent_type = 2)
Execution time : 9,958.644 ms