explain.depesz.com

PostgreSQL's explain analyze made readable

Result: obOj

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.294 646.951 ↑ 1.0 1 1

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

2. 8.178 645.657 ↓ 11,449.0 11,449 1

Nested Loop Left Join (cost=37.20..4,509.70 rows=1 width=0) (actual time=0.064..645.657 rows=11,449 loops=1)

3. 1.125 637.479 ↓ 11,449.0 11,449 1

Nested Loop Left Join (cost=37.05..4,504.54 rows=1 width=4) (actual time=0.060..637.479 rows=11,449 loops=1)

4. 3.687 395.925 ↓ 11,449.0 11,449 1

Nested Loop Left Join (cost=32.39..4,498.65 rows=1 width=4) (actual time=0.031..395.925 rows=11,449 loops=1)

5. 0.000 25.870 ↓ 11,449.0 11,449 1

Nested Loop (cost=0.29..685.82 rows=1 width=4) (actual time=0.021..25.870 rows=11,449 loops=1)

6. 3.101 3.101 ↓ 545.2 11,449 1

Seq Scan on contact c (cost=0.00..519.30 rows=21 width=44) (actual time=0.010..3.101 rows=11,449 loops=1)

  • Filter: ((deleted_timestamp IS NULL) AND ((board >= 1) OR (board IS NULL)))
  • Rows Removed by Filter: 1295
7. 22.898 22.898 ↑ 1.0 1 11,449

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

  • Index Cond: (id = c.company_id)
  • Filter: (deleted_timestamp IS NULL)
8. 11.449 366.368 ↓ 0.0 0 11,449

GroupAggregate (cost=32.10..3,812.82 rows=1 width=20) (actual time=0.032..0.032 rows=0 loops=11,449)

  • Group Key: pd.contact_id
9. 157.502 354.919 ↓ 4.4 22 11,449

Nested Loop (cost=32.10..3,812.80 rows=5 width=4) (actual time=0.011..0.031 rows=22 loops=11,449)

10. 34.347 57.245 ↓ 2.0 2 11,449

Bitmap Heap Scan on position_description pd (cost=6.06..800.09 rows=1 width=12) (actual time=0.003..0.005 rows=2 loops=11,449)

  • Recheck Cond: (contact_id = c.id)
  • Filter: (position_category = 1)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=39775
11. 22.898 22.898 ↑ 59.0 4 11,449

Bitmap Index Scan on position_description__contact_id__fkey (cost=0.00..6.06 rows=236 width=0) (actual time=0.002..0.002 rows=4 loops=11,449)

  • Index Cond: (contact_id = c.id)
12. 93.448 140.172 ↑ 112.8 11 23,362

Bitmap Heap Scan on position_candidate pc_1 (cost=26.04..3,000.30 rows=1,241 width=4) (actual time=0.003..0.006 rows=11 loops=23,362)

  • Recheck Cond: (position_description_id = pd.id)
  • Heap Blocks: exact=99648
13. 46.724 46.724 ↑ 112.8 11 23,362

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

  • Index Cond: (position_description_id = pd.id)
14. 45.796 240.429 ↓ 0.0 0 11,449

GroupAggregate (cost=4.66..5.86 rows=1 width=36) (actual time=0.021..0.021 rows=0 loops=11,449)

  • Group Key: cgc.contact_id
15. 22.696 194.633 ↓ 0.0 0 11,449

Hash Join (cost=4.66..5.85 rows=1 width=4) (actual time=0.017..0.017 rows=0 loops=11,449)

  • Hash Cond: (cg.id = cgc.contact_group_id)
16. 0.202 0.202 ↑ 1.0 13 202

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

17. 45.796 171.735 ↓ 0.0 0 11,449

Hash (cost=4.65..4.65 rows=1 width=8) (actual time=0.015..0.015 rows=0 loops=11,449)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
18. 125.939 125.939 ↓ 0.0 0 11,449

Seq Scan on contact_group_contact cgc (cost=0.00..4.65 rows=1 width=8) (actual time=0.011..0.011 rows=0 loops=11,449)

  • Filter: (contact_id = c.id)
  • Rows Removed by Filter: 212
19. 0.000 0.000 ↓ 0.0 0 11,449

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 time=0.000..0.000 rows=0 loops=11,449)

  • Index Cond: ((record_id = c.id) AND (record_type = 'contact'::text))
  • Heap Fetches: 0
Planning time : 1.588 ms
Execution time : 647.095 ms