explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3pDK

Settings
# exclusive inclusive rows x rows loops node
1. 113.832 22,975.493 ↓ 71.3 316,629 1

Unique (cost=765,737.07..765,848.04 rows=4,439 width=162) (actual time=22,628.170..22,975.493 rows=316,629 loops=1)

  • vit_user_for_concurrent.role_fk END), j.date_trunc, ((((vit_user_for_concurrent.name)::text || ' '::text) || (vit_user_for_concurrent.surname)::text))
2. 2,372.240 22,861.661 ↓ 71.3 316,629 1

Sort (cost=765,737.07..765,748.16 rows=4,439 width=162) (actual time=22,628.166..22,861.661 rows=316,629 loops=1)

  • Sort Key: vit_school.school_id, vit_school.school_town, vit_school.school_township, vit_school.school_name, j.user_fk, vit_school.school_code, (CASE WHEN (vit_user_for_concurrent.role_fk = ANY ('{300,301}'::integer[])) THEN 2 ELSE
  • Sort Method: external merge Disk: 50,032kB
3. 116.634 20,489.421 ↓ 71.3 316,629 1

Gather (cost=758,539.96..765,468.15 rows=4,439 width=162) (actual time=18,301.626..20,489.421 rows=316,629 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 147.417 20,372.787 ↓ 60.6 158,314 2 / 2

Nested Loop (cost=757,539.96..764,024.25 rows=2,611 width=162) (actual time=18,298.164..20,372.787 rows=158,314 loops=2)

5. 222.699 18,800.539 ↓ 60.6 158,314 2 / 2

Parallel Hash Left Join (cost=757,539.54..762,867.50 rows=2,611 width=92) (actual time=18,298.062..18,800.539 rows=158,314 loops=2)

  • Hash Cond: ((j.user_fk)::text = (vit_user_for_concurrent.id)::text)
6. 250.033 9,186.432 ↓ 60.6 158,314 2 / 2

Parallel Hash Join (cost=379,202.03..384,520.12 rows=2,611 width=73) (actual time=8,903.331..9,186.432 rows=158,314 loops=2)

  • Hash Cond: ((j.user_fk)::text = (vit_user_school_for_concurrent.user_fk)::text)
7. 35.572 35.572 ↑ 1.2 151,860 2 / 2

Parallel Seq Scan on eba_justidforconcurrent j (cost=0.00..4,641.59 rows=178,659 width=41) (actual time=0.016..35.572 rows=151,860 loops=2)

8. 162.943 8,900.827 ↓ 2.0 158,314 2 / 2

Parallel Hash (cost=378,215.12..378,215.12 rows=78,953 width=98) (actual time=8,900.827..8,900.827 rows=158,314 loops=2)

  • Buckets: 524,288 Batches: 1 Memory Usage: 46,336kB
9. 5,250.248 8,737.884 ↓ 2.0 158,314 2 / 2

Parallel Hash Semi Join (cost=6,874.83..378,215.12 rows=78,953 width=98) (actual time=105.866..8,737.884 rows=158,314 loops=2)

  • Hash Cond: ((vit_user_school_for_concurrent.user_fk)::text = (eba_justidforconcurrent.user_fk)::text)
10. 3,385.443 3,385.443 ↓ 2.0 11,234,662 2 / 2

Parallel Seq Scan on vit_user_school_for_concurrent (cost=0.00..355,716.42 rows=5,617,342 width=65) (actual time=0.016..3,385.443 rows=11,234,662 loops=2)

11. 73.935 102.193 ↑ 1.2 151,860 2 / 2

Parallel Hash (cost=4,641.59..4,641.59 rows=178,659 width=33) (actual time=102.192..102.193 rows=151,860 loops=2)

  • Buckets: 524,288 Batches: 1 Memory Usage: 25,536kB
12. 28.258 28.258 ↑ 1.2 151,860 2 / 2

Parallel Seq Scan on eba_justidforconcurrent (cost=0.00..4,641.59 rows=178,659 width=33) (actual time=0.020..28.258 rows=151,860 loops=2)

13. 130.828 9,391.408 ↓ 2.0 151,684 2 / 2

Parallel Hash (cost=377,388.38..377,388.38 rows=75,930 width=52) (actual time=9,391.408..9,391.408 rows=151,684 loops=2)

  • Buckets: 524,288 Batches: 1 Memory Usage: 30,720kB
14. 5,104.316 9,260.580 ↓ 2.0 151,684 2 / 2

Parallel Hash Semi Join (cost=6,874.83..377,388.38 rows=75,930 width=52) (actual time=110.166..9,260.580 rows=151,684 loops=2)

  • Hash Cond: ((vit_user_for_concurrent.id)::text = (eba_justidforconcurrent_1.user_fk)::text)
15. 4,049.313 4,049.313 ↓ 2.0 12,193,240 2 / 2

Parallel Seq Scan on vit_user_for_concurrent (cost=0.00..353,664.96 rows=6,096,716 width=52) (actual time=0.041..4,049.313 rows=12,193,240 loops=2)

16. 73.826 106.951 ↑ 1.2 151,860 2 / 2

Parallel Hash (cost=4,641.59..4,641.59 rows=178,659 width=33) (actual time=106.951..106.951 rows=151,860 loops=2)

  • Buckets: 524,288 Batches: 1 Memory Usage: 25,536kB
17. 33.125 33.125 ↑ 1.2 151,860 2 / 2

Parallel Seq Scan on eba_justidforconcurrent eba_justidforconcurrent_1 (cost=0.00..4,641.59 rows=178,659 width=33) (actual time=0.029..33.125 rows=151,860 loops=2)

18. 1,424.830 1,424.830 ↑ 1.0 1 316,629 / 2

Index Scan using vit_school_pk on vit_school (cost=0.42..0.44 rows=1 width=85) (actual time=0.009..0.009 rows=1 loops=316,629)

  • Index Cond: (((school_id)::text = (vit_user_school_for_concurrent.school_fk)::text) AND (school_id IS NOT NULL))
Planning time : 2.109 ms
Execution time : 23,025.462 ms