explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QPM : Optimization for: plan #obOj

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=4,509.70..4,509.71 rows=1 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=37.20..4,509.70 rows=1 width=0) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=37.05..4,504.54 rows=1 width=4) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=32.39..4,498.65 rows=1 width=4) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..685.82 rows=1 width=4) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Seq Scan on contact c (cost=0.00..519.30 rows=21 width=44) (actual rows= loops=)

  • Filter: ((deleted_timestamp IS NULL) AND ((board >= 1) OR (board IS NULL)))
7. 0.000 0.000 ↓ 0.0

Index Scan using company__pkey on company co (cost=0.29..7.92 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = c.company_id)
  • Filter: (deleted_timestamp IS NULL)
8. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=32.10..3,812.82 rows=1 width=20) (actual rows= loops=)

  • Group Key: pd.contact_id
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=32.10..3,812.80 rows=5 width=4) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on position_description pd (cost=6.06..800.09 rows=1 width=12) (actual rows= loops=)

  • Recheck Cond: (contact_id = c.id)
  • Filter: (position_category = 1)
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on position_description__contact_id__fkey (cost=0.00..6.06 rows=236 width=0) (actual rows= loops=)

  • Index Cond: (contact_id = c.id)
12. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on position_candidate pc_1 (cost=26.04..3,000.30 rows=1,241 width=4) (actual rows= loops=)

  • Recheck Cond: (position_description_id = pd.id)
13. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_pc_pd (cost=0.00..25.73 rows=1,241 width=0) (actual rows= loops=)

  • Index Cond: (position_description_id = pd.id)
14. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4.66..5.86 rows=1 width=36) (actual rows= loops=)

  • Group Key: cgc.contact_id
15. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.66..5.85 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (cg.id = cgc.contact_group_id)
16. 0.000 0.000 ↓ 0.0

Seq Scan on contact_group cg (cost=0.00..1.13 rows=13 width=8) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash (cost=4.65..4.65 rows=1 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on contact_group_contact cgc (cost=0.00..4.65 rows=1 width=8) (actual rows= loops=)

  • Filter: (contact_id = c.id)
19. 0.000 0.000 ↓ 0.0

Index Only Scan using branch_record_branch_id_record_id_record_type_key on branch_record br (cost=0.15..5.15 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((record_id = c.id) AND (record_type = 'contact'::text))