explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v3kx

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 415.374 ↑ 2.0 1 1

Sort (cost=14,682.95..14,682.95 rows=2 width=103) (actual time=415.373..415.374 rows=1 loops=1)

  • Sort Key: cg.name
  • Sort Method: quicksort Memory: 25kB
2. 0.011 415.365 ↑ 2.0 1 1

Hash Left Join (cost=13,564.94..14,682.94 rows=2 width=103) (actual time=380.971..415.365 rows=1 loops=1)

  • Hash Cond: (cg.id = uc.candidate_group_id)
3. 0.005 413.436 ↑ 2.0 1 1

Nested Loop (cost=13,513.85..14,631.74 rows=2 width=71) (actual time=379.043..413.436 rows=1 loops=1)

4. 0.434 413.422 ↑ 2.0 1 1

Nested Loop Semi Join (cost=13,513.58..14,630.32 rows=2 width=54) (actual time=379.031..413.422 rows=1 loops=1)

  • Join Filter: (cg.id = candidate_group_candidate.candidate_group_id)
  • Rows Removed by Join Filter: 788
5. 0.953 409.043 ↑ 1.2 789 1

Merge Left Join (cost=13,513.58..13,870.41 rows=931 width=54) (actual time=375.284..409.043 rows=789 loops=1)

  • Merge Cond: (cg.id = candidate_group_candidate_1.candidate_group_id)
6. 0.547 0.547 ↑ 1.2 789 1

Index Scan using candidate_group_pkey on candidate_group cg (cost=0.28..39.12 rows=931 width=46) (actual time=0.013..0.547 rows=789 loops=1)

7. 0.423 407.543 ↓ 1.0 722 1

Materialize (cost=13,513.30..13,820.37 rows=688 width=12) (actual time=375.266..407.543 rows=722 loops=1)

8. 18.914 407.120 ↓ 1.0 722 1

GroupAggregate (cost=13,513.30..13,811.77 rows=688 width=8) (actual time=375.263..407.120 rows=722 loops=1)

  • Group Key: candidate_group_candidate_1.candidate_group_id
9. 30.753 388.206 ↓ 1.0 39,233 1

Sort (cost=13,513.30..13,610.50 rows=38,878 width=8) (actual time=375.248..388.206 rows=39,233 loops=1)

  • Sort Key: candidate_group_candidate_1.candidate_group_id
  • Sort Method: quicksort Memory: 3150kB
10. 142.272 357.453 ↓ 1.0 39,233 1

Merge Join (cost=3,599.02..10,549.50 rows=38,878 width=8) (actual time=61.456..357.453 rows=39,233 loops=1)

  • Merge Cond: (candidate_group_candidate_1.candidate_id = can.id)
11. 49.739 76.820 ↓ 1.0 39,233 1

Sort (cost=3,598.58..3,695.77 rows=38,878 width=8) (actual time=61.433..76.820 rows=39,233 loops=1)

  • Sort Key: candidate_group_candidate_1.candidate_id
  • Sort Method: quicksort Memory: 3150kB
12. 27.081 27.081 ↓ 1.0 39,233 1

Seq Scan on candidate_group_candidate candidate_group_candidate_1 (cost=0.00..634.78 rows=38,878 width=8) (actual time=0.012..27.081 rows=39,233 loops=1)

13. 138.361 138.361 ↓ 1.0 311,302 1

Index Only Scan using candidate_pkey on candidate can (cost=0.42..5,644.08 rows=297,777 width=8) (actual time=0.019..138.361 rows=311,302 loops=1)

  • Heap Fetches: 8465
14. 0.883 3.945 ↑ 2.0 1 789

Materialize (cost=0.00..731.99 rows=2 width=4) (actual time=0.000..0.005 rows=1 loops=789)

15. 3.062 3.062 ↑ 2.0 1 1

Seq Scan on candidate_group_candidate (cost=0.00..731.98 rows=2 width=4) (actual time=0.009..3.062 rows=1 loops=1)

  • Filter: (candidate_id = 334460)
  • Rows Removed by Filter: 39232
16. 0.009 0.009 ↑ 1.0 1 1

Index Scan using client_account_pkey on user_account (cost=0.27..0.70 rows=1 width=21) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (id = cg.owner_id)
17. 0.137 1.918 ↑ 1.1 353 1

Hash (cost=46.18..46.18 rows=393 width=36) (actual time=1.918..1.918 rows=353 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
18. 0.194 1.781 ↑ 1.1 353 1

Subquery Scan on uc (cost=36.35..46.18 rows=393 width=36) (actual time=1.182..1.781 rows=353 loops=1)

19. 1.137 1.587 ↑ 1.1 353 1

HashAggregate (cost=36.35..42.25 rows=393 width=8) (actual time=1.181..1.587 rows=353 loops=1)

  • Group Key: candidate_group_user_account.candidate_group_id
20. 0.450 0.450 ↑ 1.1 1,495 1

Seq Scan on candidate_group_user_account (cost=0.00..27.90 rows=1,690 width=8) (actual time=0.005..0.450 rows=1,495 loops=1)

Planning time : 1.625 ms