explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hCOM

Settings
# exclusive inclusive rows x rows loops node
1. 1.143 49.568 ↑ 1.1 622 1

Sort (cost=57,125.85..57,127.51 rows=663 width=56) (actual time=49.364..49.568 rows=622 loops=1)

  • Sort Key: cg.name
  • Sort Method: quicksort Memory: 110kB
2. 1.070 48.425 ↑ 1.1 622 1

Nested Loop Left Join (cost=148.33..57,094.78 rows=663 width=56) (actual time=0.589..48.425 rows=622 loops=1)

3. 0.631 3.193 ↑ 1.1 622 1

Hash Left Join (cost=147.91..7,254.70 rows=663 width=48) (actual time=0.498..3.193 rows=622 loops=1)

  • Hash Cond: (cg.owner_id = ua.id)
  • Filter: (((ua.system_admin = 0) AND (ua.deleted_timestamp IS NULL) AND (cg.owner_id = 29104)) OR (cg.share_permission = 2) OR ((cg.share_permission = 1) AND (alternatives: SubPlan 1 or hashed SubPlan 2)))
4. 2.063 2.072 ↑ 2.0 622 1

Seq Scan on candidate_group cg (cost=0.00..4,971.46 rows=1,257 width=34) (actual time=0.011..2.072 rows=622 loops=1)

  • Filter: ((owner_id = 29104) OR (share_permission = 2) OR ((share_permission = 1) AND (alternatives: SubPlan 1 or hashed SubPlan 2)))
  • Rows Removed by Filter: 1765
5.          

SubPlan (forSeq Scan)

6. 0.000 0.000 ↓ 0.0 0

Seq Scan on candidate_group_user_account cgua (cost=0.00..1.67 rows=1 width=0) (never executed)

  • Filter: ((cg.id = candidate_group_id) AND (user_account_id = 29104))
7. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on candidate_group_user_account cgua_1 (cost=0.00..1.56 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=1)

  • Filter: (user_account_id = 29104)
  • Rows Removed by Filter: 56
8. 0.100 0.481 ↑ 1.0 223 1

Hash (cost=145.13..145.13 rows=223 width=28) (actual time=0.481..0.481 rows=223 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
9. 0.381 0.381 ↑ 1.0 223 1

Index Scan using client_account_pkey on user_account ua (cost=0.14..145.13 rows=223 width=28) (actual time=0.007..0.381 rows=223 loops=1)

10.          

SubPlan (forHash Left Join)

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on candidate_group_user_account cgua (cost=0.00..1.67 rows=1 width=0) (never executed)

  • Filter: ((cg.id = candidate_group_id) AND (user_account_id = 29104))
12. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on candidate_group_user_account cgua_1 (cost=0.00..1.56 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=1)

  • Filter: (user_account_id = 29104)
  • Rows Removed by Filter: 56
13. 19.904 44.162 ↑ 1.0 1 622

GroupAggregate (cost=0.42..75.15 rows=1 width=8) (actual time=0.071..0.071 rows=1 loops=622)

  • Group Key: cgc.candidate_group_id
14. 24.258 24.258 ↑ 1.3 62 622

Index Scan using candidate_group_candidate_cgi_idx on candidate_group_candidate cgc (cost=0.42..74.73 rows=83 width=8) (actual time=0.004..0.039 rows=62 loops=622)

  • Index Cond: (cg.id = candidate_group_id)