explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gW1m

Settings
# exclusive inclusive rows x rows loops node
1. 319.079 19,832.049 ↓ 46.4 479,578 1

Unique (cost=785,212.42..785,470.94 rows=10,341 width=162) (actual time=19,357.130..19,832.049 rows=479,578 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. 4,105.585 19,512.970 ↓ 46.4 479,578 1

Sort (cost=785,212.42..785,238.27 rows=10,341 width=162) (actual time=19,357.124..19,512.970 rows=479,578 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: 139,675kB
3. 74.075 15,407.385 ↓ 46.4 479,578 1

Gather (cost=771,074.92..784,522.88 rows=10,341 width=162) (actual time=13,246.757..15,407.385 rows=479,578 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 255.235 15,333.310 ↓ 37.1 159,859 3 / 3

Nested Loop (cost=770,074.92..782,488.78 rows=4,309 width=162) (actual time=13,240.658..15,333.310 rows=159,859 loops=3)

5. 240.299 13,799.200 ↓ 37.1 159,859 3 / 3

Parallel Hash Left Join (cost=770,074.51..780,579.76 rows=4,309 width=92) (actual time=13,240.422..13,799.200 rows=159,859 loops=3)

  • Hash Cond: ((j.user_fk)::text = (vit_user_for_concurrent.id)::text)
6. 282.021 6,385.086 ↓ 37.1 159,859 3 / 3

Parallel Hash Join (cost=385,483.49..395,972.38 rows=4,309 width=73) (actual time=6,064.029..6,385.086 rows=159,859 loops=3)

  • Hash Cond: ((j.user_fk)::text = (vit_user_school_for_concurrent.user_fk)::text)
7. 41.505 41.505 ↑ 1.2 155,120 3 / 3

Parallel Seq Scan on eba_justidforconcurrent j (cost=0.00..9,751.00 rows=193,900 width=41) (actual time=0.053..41.505 rows=155,120 loops=3)

8. 152.631 6,061.560 ↓ 1.3 159,859 3 / 3

Parallel Hash (cost=383,977.12..383,977.12 rows=120,509 width=98) (actual time=6,061.560..6,061.560 rows=159,859 loops=3)

  • Buckets: 524,288 Batches: 1 Memory Usage: 68,096kB
9. 3,568.310 5,908.929 ↓ 1.3 159,859 3 / 3

Parallel Hash Semi Join (cost=12,174.75..383,977.12 rows=120,509 width=98) (actual time=98.358..5,908.929 rows=159,859 loops=3)

  • Hash Cond: ((vit_user_school_for_concurrent.user_fk)::text = (eba_justidforconcurrent.user_fk)::text)
10. 2,243.785 2,243.785 ↓ 1.3 7,489,775 3 / 3

Parallel Seq Scan on vit_user_school_for_concurrent (cost=0.00..355,716.24 rows=5,617,324 width=65) (actual time=0.041..2,243.785 rows=7,489,775 loops=3)

11. 68.806 96.834 ↑ 1.2 155,120 3 / 3

Parallel Hash (cost=9,751.00..9,751.00 rows=193,900 width=33) (actual time=96.833..96.834 rows=155,120 loops=3)

  • Buckets: 524,288 Batches: 1 Memory Usage: 36,960kB
12. 28.028 28.028 ↑ 1.2 155,120 3 / 3

Parallel Seq Scan on eba_justidforconcurrent (cost=0.00..9,751.00 rows=193,900 width=33) (actual time=0.026..28.028 rows=155,120 loops=3)

13. 126.896 7,173.815 ↓ 1.3 154,907 3 / 3

Parallel Hash (cost=383,136.77..383,136.77 rows=116,340 width=52) (actual time=7,173.815..7,173.815 rows=154,907 loops=3)

  • Buckets: 524,288 Batches: 1 Memory Usage: 44,864kB
14. 3,817.339 7,046.919 ↓ 1.3 154,907 3 / 3

Parallel Hash Semi Join (cost=12,174.75..383,136.77 rows=116,340 width=52) (actual time=120.433..7,046.919 rows=154,907 loops=3)

  • Hash Cond: ((vit_user_for_concurrent.id)::text = (eba_justidforconcurrent_1.user_fk)::text)
15. 3,111.870 3,111.870 ↓ 1.3 8,128,827 3 / 3

Parallel Seq Scan on vit_user_for_concurrent (cost=0.00..353,664.05 rows=6,096,644 width=52) (actual time=0.046..3,111.870 rows=8,128,827 loops=3)

16. 80.086 117.710 ↑ 1.2 155,120 3 / 3

Parallel Hash (cost=9,751.00..9,751.00 rows=193,900 width=33) (actual time=117.710..117.710 rows=155,120 loops=3)

  • Buckets: 524,288 Batches: 1 Memory Usage: 36,928kB
17. 37.624 37.624 ↑ 1.2 155,120 3 / 3

Parallel Seq Scan on eba_justidforconcurrent eba_justidforconcurrent_1 (cost=0.00..9,751.00 rows=193,900 width=33) (actual time=0.038..37.624 rows=155,120 loops=3)

18. 1,278.875 1,278.875 ↑ 1.0 1 479,578 / 3

Index Scan using vit_school_pk on vit_school (cost=0.42..0.44 rows=1 width=85) (actual time=0.008..0.008 rows=1 loops=479,578)

  • Index Cond: (((school_id)::text = (vit_user_school_for_concurrent.school_fk)::text) AND (school_id IS NOT NULL))
Planning time : 1.860 ms
Execution time : 19,913.240 ms