explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xwcV

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.893 ↓ 0.0 0 1

Insert on users_view (cost=265.97..378.12 rows=1 width=120) (actual time=0.893..0.893 rows=0 loops=1)

  • Conflict Resolution: UPDATE
  • Conflict Arbiter Indexes: user_view_id_key
  • Tuples Inserted: 0
  • Conflicting Tuples: 0
2. 0.115 0.891 ↓ 0.0 0 1

Hash Full Join (cost=265.97..378.12 rows=1 width=120) (actual time=0.891..0.891 rows=0 loops=1)

  • Hash Cond: ((u.id = cuv.id) AND (u.created = cuv.created) AND (((array_remove(array_agg(p.value), NULL::character varying))::text[]) = cuv.phones) AND (((array_remove(array_agg(DISTINCT r.title), NULL::character varying))::text[]) = cuv.roles) AND (((array_remove(array_agg(DISTINCT e.value), NULL::character varying))::text[]) = cuv.emails))
  • Filter: (cuv.id IS NULL)
  • Rows Removed by Filter: 20
3. 0.140 0.642 ↑ 92.5 20 1

GroupAggregate (cost=263.32..332.69 rows=1,850 width=112) (actual time=0.595..0.642 rows=20 loops=1)

  • Group Key: u.id
4. 0.043 0.502 ↑ 88.1 21 1

Sort (cost=263.32..267.94 rows=1,850 width=1,166) (actual time=0.499..0.502 rows=21 loops=1)

  • Sort Key: u.id
  • Sort Method: quicksort Memory: 26kB
5. 0.051 0.459 ↑ 88.1 21 1

Hash Left Join (cost=128.23..162.93 rows=1,850 width=1,166) (actual time=0.440..0.459 rows=21 loops=1)

  • Hash Cond: (ur.role_id = r.id)
6. 0.064 0.380 ↑ 88.1 21 1

Hash Left Join (cost=115.08..144.82 rows=1,850 width=658) (actual time=0.366..0.380 rows=21 loops=1)

  • Hash Cond: (u.id = e.user_id)
7. 0.066 0.286 ↑ 88.1 21 1

Hash Right Join (cost=101.93..123.33 rows=1,850 width=142) (actual time=0.276..0.286 rows=21 loops=1)

  • Hash Cond: (p.user_id = u.id)
8. 0.026 0.026 ↑ 240.0 2 1

Seq Scan on phones p (cost=0.00..14.80 rows=480 width=126) (actual time=0.025..0.026 rows=2 loops=1)

9. 0.016 0.194 ↑ 92.5 20 1

Hash (cost=78.81..78.81 rows=1,850 width=24) (actual time=0.194..0.194 rows=20 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
10. 0.086 0.178 ↑ 92.5 20 1

Hash Right Join (cost=51.62..78.81 rows=1,850 width=24) (actual time=0.168..0.178 rows=20 loops=1)

  • Hash Cond: (ur.user_id = u.id)
11. 0.024 0.024 ↑ 1,360.0 1 1

Seq Scan on user_roles ur (cost=0.00..23.60 rows=1,360 width=16) (actual time=0.023..0.024 rows=1 loops=1)

12. 0.025 0.068 ↑ 92.5 20 1

Hash (cost=28.50..28.50 rows=1,850 width=16) (actual time=0.068..0.068 rows=20 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
13. 0.043 0.043 ↑ 92.5 20 1

Seq Scan on users u (cost=0.00..28.50 rows=1,850 width=16) (actual time=0.040..0.043 rows=20 loops=1)

14. 0.011 0.030 ↑ 140.0 1 1

Hash (cost=11.40..11.40 rows=140 width=524) (actual time=0.030..0.030 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.019 0.019 ↑ 140.0 1 1

Seq Scan on emails e (cost=0.00..11.40 rows=140 width=524) (actual time=0.018..0.019 rows=1 loops=1)

16. 0.013 0.028 ↑ 140.0 1 1

Hash (cost=11.40..11.40 rows=140 width=524) (actual time=0.028..0.028 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.015 0.015 ↑ 140.0 1 1

Seq Scan on roles r (cost=0.00..11.40 rows=140 width=524) (actual time=0.015..0.015 rows=1 loops=1)

18. 0.023 0.134 ↑ 1.0 20 1

Hash (cost=2.20..2.20 rows=20 width=59) (actual time=0.134..0.134 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
19. 0.111 0.111 ↑ 1.0 20 1

Seq Scan on users_view cuv (cost=0.00..2.20 rows=20 width=59) (actual time=0.064..0.111 rows=20 loops=1)

Planning time : 1.906 ms
Execution time : 1.586 ms