explain.depesz.com

PostgreSQL's explain analyze made readable

Result: x6OS

Settings
# exclusive inclusive rows x rows loops node
1. 1.657 625.209 ↑ 1.0 1 1

Aggregate (cost=14,012,220.47..14,012,220.48 rows=1 width=8) (actual time=625.209..625.209 rows=1 loops=1)

2. 3.064 623.552 ↑ 312.0 8,948 1

Nested Loop Left Join (cost=1,273.31..14,005,241.03 rows=2,791,776 width=0) (actual time=14.159..623.552 rows=8,948 loops=1)

3. 8.379 504.164 ↑ 39.0 8,948 1

Nested Loop Left Join (cost=1,273.31..3,188,853.89 rows=348,972 width=4) (actual time=14.063..504.164 rows=8,948 loops=1)

4. 4.541 93.125 ↑ 1.0 8,948 1

Nested Loop Left Join (cost=991.84..658,074.98 rows=8,948 width=4) (actual time=13.959..93.125 rows=8,948 loops=1)

5. 6.802 25.948 ↑ 1.0 8,948 1

Hash Join (cost=991.14..1,387.00 rows=8,948 width=4) (actual time=13.913..25.948 rows=8,948 loops=1)

  • Hash Cond: (c.company_id = co.id)
6. 5.440 5.440 ↑ 1.0 8,948 1

Seq Scan on contact c (cost=0.00..372.38 rows=8,948 width=36) (actual time=0.029..5.440 rows=8,948 loops=1)

  • Filter: ((deleted_timestamp IS NULL) AND ((board >= 1) OR (board IS NULL)))
  • Rows Removed by Filter: 1002
7. 5.956 13.706 ↑ 1.0 22,095 1

Hash (cost=714.95..714.95 rows=22,095 width=8) (actual time=13.706..13.706 rows=22,095 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1048kB
8. 7.750 7.750 ↑ 1.0 22,095 1

Seq Scan on company co (cost=0.00..714.95 rows=22,095 width=8) (actual time=0.030..7.750 rows=22,095 loops=1)

9. 0.000 62.636 ↓ 0.0 0 8,948

GroupAggregate (cost=0.70..73.37 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=8,948)

  • Group Key: pd.contact_id
10. 7.821 62.636 ↓ 0.0 0 8,948

Nested Loop (cost=0.70..73.34 rows=8 width=4) (actual time=0.006..0.007 rows=0 loops=8,948)

11. 53.688 53.688 ↓ 0.0 0 8,948

Index Scan using position_description__contact_id__fkey on position_description pd (cost=0.29..21.22 rows=1 width=12) (actual time=0.006..0.006 rows=0 loops=8,948)

  • Index Cond: (contact_id = c.id)
  • Filter: (floated_job = 1)
  • Rows Removed by Filter: 2
12. 1.127 1.127 ↑ 7.5 2 161

Index Only Scan using index_pc_pd on position_candidate pc_1 (cost=0.42..51.97 rows=15 width=4) (actual time=0.006..0.007 rows=2 loops=161)

  • Index Cond: (position_description_id = pd.id)
  • Heap Fetches: 286
13. 26.844 402.660 ↓ 0.0 0 8,948

GroupAggregate (cost=281.47..282.05 rows=39 width=12) (actual time=0.045..0.045 rows=0 loops=8,948)

  • Group Key: temp.contact_id
14. 44.740 375.816 ↑ 3.0 13 8,948

Sort (cost=281.47..281.56 rows=39 width=4) (actual time=0.041..0.042 rows=13 loops=8,948)

  • Sort Key: temp.contact_id
  • Sort Method: quicksort Memory: 25kB
15. 17.896 331.076 ↑ 3.0 13 8,948

Subquery Scan on temp (cost=279.75..280.44 rows=39 width=4) (actual time=0.031..0.037 rows=13 loops=8,948)

16. 35.792 313.180 ↑ 3.0 13 8,948

Group (cost=279.75..280.05 rows=39 width=8) (actual time=0.031..0.035 rows=13 loops=8,948)

  • Group Key: pd_1.contact_id, pc_1_1.candidate_id
17. 62.636 277.388 ↑ 2.8 14 8,948

Sort (cost=279.75..279.85 rows=39 width=8) (actual time=0.030..0.031 rows=14 loops=8,948)

  • Sort Key: pc_1_1.candidate_id
  • Sort Method: quicksort Memory: 25kB
18. 25.229 214.752 ↑ 2.8 14 8,948

Nested Loop (cost=0.70..278.72 rows=39 width=8) (actual time=0.006..0.024 rows=14 loops=8,948)

19. 44.740 44.740 ↑ 2.5 2 8,948

Index Scan using position_description__contact_id__fkey on position_description pd_1 (cost=0.29..21.22 rows=5 width=12) (actual time=0.002..0.005 rows=2 loops=8,948)

  • Index Cond: (contact_id = c.id)
  • Filter: (floated_job = 0)
  • Rows Removed by Filter: 0
20. 144.783 144.783 ↑ 1.9 8 16,087

Index Scan using index_pc_pd on position_candidate pc_1_1 (cost=0.42..51.35 rows=15 width=8) (actual time=0.004..0.009 rows=8 loops=16,087)

  • Index Cond: (position_description_id = pd_1.id)
21. 62.636 116.324 ↓ 0.0 0 8,948

GroupAggregate (cost=0.00..30.84 rows=8 width=36) (actual time=0.013..0.013 rows=0 loops=8,948)

  • Group Key: cgc.contact_id
22. 44.740 53.688 ↓ 0.0 0 8,948

Nested Loop (cost=0.00..30.74 rows=8 width=4) (actual time=0.006..0.006 rows=0 loops=8,948)

  • Join Filter: (cgc.contact_group_id = cg.id)
23. 8.948 8.948 ↑ 1.0 1 8,948

Seq Scan on contact_group cg (cost=0.00..1.01 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=8,948)

24. 0.000 0.000 ↓ 0.0 0 8,948

Seq Scan on contact_group_contact cgc (cost=0.00..29.63 rows=8 width=8) (actual time=0.000..0.000 rows=0 loops=8,948)

  • Filter: (contact_id = c.id)