explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 55wl

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

Sort (cost=11,219.82..11,219.83 rows=2 width=103) (actual time=386.885..386.885 rows=1 loops=1)

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

Nested Loop (cost=10,908.75..11,219.81 rows=2 width=103) (actual time=386.768..386.876 rows=1 loops=1)

3. 0.012 386.852 ↑ 2.0 1 1

Merge Right Join (cost=10,908.47..11,218.40 rows=2 width=86) (actual time=386.748..386.852 rows=1 loops=1)

  • Merge Cond: (candidate_group_candidate_1.candidate_group_id = cg.id)
4. 0.513 384.835 ↑ 139.2 5 1

GroupAggregate (cost=10,854.77..11,155.98 rows=696 width=8) (actual time=383.972..384.835 rows=5 loops=1)

  • Group Key: candidate_group_candidate_1.candidate_group_id
5. 21.004 384.322 ↑ 40.9 959 1

Sort (cost=10,854.77..10,952.86 rows=39,233 width=8) (actual time=383.935..384.322 rows=959 loops=1)

  • Sort Key: candidate_group_candidate_1.candidate_group_id
  • Sort Method: quicksort Memory: 3150kB
6. 172.247 363.318 ↑ 1.0 39,233 1

Merge Join (cost=0.71..7,861.34 rows=39,233 width=8) (actual time=0.056..363.318 rows=39,233 loops=1)

  • Merge Cond: (candidate_group_candidate_1.candidate_id = can.id)
7. 29.302 29.302 ↑ 1.0 39,233 1

Index Scan using candidate_group_candidate_candidate_id_idx on candidate_group_candidate candidate_group_candidate_1 (cost=0.29..977.32 rows=39,233 width=8) (actual time=0.015..29.302 rows=39,233 loops=1)

8. 161.769 161.769 ↓ 1.0 311,302 1

Index Only Scan using candidate_pkey on candidate can (cost=0.42..5,650.28 rows=297,971 width=8) (actual time=0.034..161.769 rows=311,302 loops=1)

  • Heap Fetches: 16
9. 0.013 2.005 ↑ 2.0 1 1

Sort (cost=53.70..53.70 rows=2 width=78) (actual time=2.005..2.005 rows=1 loops=1)

  • Sort Key: cg.id
  • Sort Method: quicksort Memory: 25kB
10. 0.134 1.992 ↑ 2.0 1 1

Hash Right Join (cost=42.38..53.69 rows=2 width=78) (actual time=1.829..1.992 rows=1 loops=1)

  • Hash Cond: (candidate_group_user_account.candidate_group_id = cg.id)
11. 1.260 1.810 ↑ 1.1 353 1

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

  • Group Key: candidate_group_user_account.candidate_group_id
12. 0.550 0.550 ↑ 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.006..0.550 rows=1,495 loops=1)

13. 0.008 0.048 ↑ 2.0 1 1

Hash (cost=6.01..6.01 rows=2 width=46) (actual time=0.048..0.048 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.010 0.040 ↑ 2.0 1 1

Nested Loop (cost=3.77..6.01 rows=2 width=46) (actual time=0.038..0.040 rows=1 loops=1)

15. 0.009 0.023 ↑ 1.0 1 1

HashAggregate (cost=3.49..3.50 rows=1 width=4) (actual time=0.022..0.023 rows=1 loops=1)

  • Group Key: candidate_group_candidate.candidate_group_id
16. 0.014 0.014 ↑ 2.0 1 1

Index Scan using candidate_group_candidate_candidate_id_idx on candidate_group_candidate (cost=0.29..3.49 rows=2 width=4) (actual time=0.013..0.014 rows=1 loops=1)

  • Index Cond: (candidate_id = 334460)
17. 0.007 0.007 ↑ 1.0 1 1

Index Scan using candidate_group_pkey on candidate_group cg (cost=0.28..2.49 rows=1 width=46) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (id = candidate_group_candidate.candidate_group_id)
18. 0.011 0.011 ↑ 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.011..0.011 rows=1 loops=1)

  • Index Cond: (id = cg.owner_id)
Planning time : 2.021 ms