explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5OiJ

Settings
# exclusive inclusive rows x rows loops node
1. 133.059 17,093.554 ↓ 170.7 222,564 1

Unique (cost=384,876.69..384,909.29 rows=1,304 width=162) (actual time=16,892.838..17,093.554 rows=222,564 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. 1,618.880 16,960.495 ↓ 170.7 222,564 1

Sort (cost=384,876.69..384,879.95 rows=1,304 width=162) (actual time=16,892.833..16,960.495 rows=222,564 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: quicksort Memory: 65,262kB
3. 58.631 15,341.615 ↓ 170.7 222,564 1

Gather (cost=376,769.14..384,809.22 rows=1,304 width=162) (actual time=8,075.384..15,341.615 rows=222,564 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 220.061 15,282.984 ↓ 145.1 111,282 2 / 2

Nested Loop (cost=375,769.14..383,678.82 rows=767 width=162) (actual time=8,070.241..15,282.984 rows=111,282 loops=2)

5. 132.484 13,950.103 ↓ 145.1 111,282 2 / 2

Nested Loop Left Join (cost=375,768.72..383,339.02 rows=767 width=92) (actual time=8,070.163..13,950.103 rows=111,282 loops=2)

6. 258.870 8,364.801 ↓ 145.1 111,282 2 / 2

Parallel Hash Join (cost=375,767.74..379,205.42 rows=767 width=73) (actual time=8,069.871..8,364.801 rows=111,282 loops=2)

  • Hash Cond: ((j.user_fk)::text = (vit_user_school_for_concurrent.user_fk)::text)
7. 37.613 37.613 ↓ 1.1 107,000 2 / 2

Parallel Seq Scan on eba_justidforconcurrent j (cost=0.00..3,067.65 rows=98,165 width=41) (actual time=0.034..37.613 rows=107,000 loops=2)

8. 116.333 8,068.318 ↓ 2.6 111,282 2 / 2

Parallel Hash (cost=375,232.74..375,232.74 rows=42,800 width=98) (actual time=8,068.318..8,068.318 rows=111,282 loops=2)

  • Buckets: 262,144 Batches: 1 Memory Usage: 31,776kB
9. 5,202.741 7,951.985 ↓ 2.6 111,282 2 / 2

Parallel Hash Semi Join (cost=4,294.71..375,232.74 rows=42,800 width=98) (actual time=77.842..7,951.985 rows=111,282 loops=2)

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

Parallel Seq Scan on vit_user_school_for_concurrent (cost=0.00..355,716.37 rows=5,617,337 width=65) (actual time=0.027..2,672.678 rows=11,234,662 loops=2)

11. 48.590 76.566 ↓ 1.1 107,000 2 / 2

Parallel Hash (cost=3,067.65..3,067.65 rows=98,165 width=33) (actual time=76.566..76.566 rows=107,000 loops=2)

  • Buckets: 262,144 Batches: 1 Memory Usage: 17,152kB
12. 27.976 27.976 ↓ 1.1 107,000 2 / 2

Parallel Seq Scan on eba_justidforconcurrent (cost=0.00..3,067.65 rows=98,165 width=33) (actual time=0.040..27.976 rows=107,000 loops=2)

13. 111.282 5,452.818 ↑ 1.0 1 222,564 / 2

Nested Loop Semi Join (cost=0.98..5.38 rows=1 width=52) (actual time=0.049..0.049 rows=1 loops=222,564)

14. 4,117.434 4,117.434 ↑ 1.0 1 222,564 / 2

Index Scan using vit_user_for_concurrent_id_idx on vit_user_for_concurrent (cost=0.56..4.92 rows=1 width=52) (actual time=0.036..0.037 rows=1 loops=222,564)

  • Index Cond: ((id)::text = (j.user_fk)::text)
15. 1,224.102 1,224.102 ↑ 1.0 1 222,564 / 2

Index Only Scan using eba_justidforconcurrent_user_fk_idx on eba_justidforconcurrent eba_justidforconcurrent_1 (cost=0.42..0.44 rows=1 width=33) (actual time=0.011..0.011 rows=1 loops=222,564)

  • Index Cond: (user_fk = (vit_user_for_concurrent.id)::text)
  • Heap Fetches: 222,564
16. 1,112.820 1,112.820 ↑ 1.0 1 222,564 / 2

Index Scan using vit_school_pk on vit_school (cost=0.42..0.44 rows=1 width=85) (actual time=0.010..0.010 rows=1 loops=222,564)

  • Index Cond: (((school_id)::text = (vit_user_school_for_concurrent.school_fk)::text) AND (school_id IS NOT NULL))
Planning time : 4.072 ms
Execution time : 17,120.739 ms