explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sXoy

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 0.199 ↓ 6.0 6 1

Unique (cost=43.76..43.79 rows=1 width=108) (actual time=0.189..0.199 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Buffers: shared hit=22
2. 0.018 0.189 ↓ 6.0 6 1

Sort (cost=43.76..43.76 rows=1 width=108) (actual time=0.189..0.189 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Sort Key: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Sort Method: quicksort Memory: 28kB
  • Buffers: shared hit=22
3. 0.013 0.171 ↓ 6.0 6 1

Group (cost=26.87..43.75 rows=1 width=108) (actual time=0.089..0.171 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Group Key: problems.id
  • Buffers: shared hit=22
4. 0.006 0.158 ↓ 6.0 6 1

Nested Loop Anti Join (cost=26.87..43.75 rows=1 width=108) (actual time=0.085..0.158 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Buffers: shared hit=22
5. 0.014 0.140 ↓ 3.0 6 1

Nested Loop Left Join (cost=26.72..43.35 rows=2 width=116) (actual time=0.074..0.140 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id, topic_problems.topic_id
  • Buffers: shared hit=22
6. 0.005 0.108 ↓ 6.0 6 1

Nested Loop (cost=25.19..33.27 rows=1 width=108) (actual time=0.064..0.108 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Buffers: shared hit=16
7. 0.014 0.055 ↓ 6.0 6 1

Merge Join (cost=25.04..25.10 rows=1 width=116) (actual time=0.044..0.055 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id, subject_problems.subject_id
  • Merge Cond: (problems.id = subject_problems.problem_id)
  • Buffers: shared hit=4
8. 0.009 0.022 ↓ 2.0 6 1

Sort (cost=11.30..11.31 rows=3 width=108) (actual time=0.021..0.022 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Sort Key: problems.id
  • Sort Method: quicksort Memory: 28kB
  • Buffers: shared hit=2
9. 0.007 0.013 ↓ 2.0 6 1

Bitmap Heap Scan on public.problems (cost=4.17..11.27 rows=3 width=108) (actual time=0.011..0.013 rows=6 loops=1)

  • Output: problems.id, problems.created_at, problems.updated_at, problems.deleted_at, problems."position", problems.config, problems.state, problems.owner_type, problems.owner_id
  • Recheck Cond: (problems.deleted_at IS NULL)
  • Heap Blocks: exact=1
  • Buffers: shared hit=2
10. 0.006 0.006 ↓ 2.0 6 1

Bitmap Index Scan on index_problems_on_deleted_at (cost=0.00..4.17 rows=3 width=0) (actual time=0.006..0.006 rows=6 loops=1)

  • Index Cond: (problems.deleted_at IS NULL)
  • Buffers: shared hit=1
11. 0.009 0.019 ↑ 1.0 6 1

Sort (cost=13.74..13.76 rows=6 width=16) (actual time=0.018..0.019 rows=6 loops=1)

  • Output: subject_problems.problem_id, subject_problems.subject_id
  • Sort Key: subject_problems.problem_id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=2
12. 0.006 0.010 ↑ 1.0 6 1

Bitmap Heap Scan on public.subject_problems (cost=4.20..13.67 rows=6 width=16) (actual time=0.009..0.010 rows=6 loops=1)

  • Output: subject_problems.problem_id, subject_problems.subject_id
  • Recheck Cond: (subject_problems.subject_id = 6,308,239)
  • Heap Blocks: exact=1
  • Buffers: shared hit=2
13. 0.004 0.004 ↑ 1.0 6 1

Bitmap Index Scan on index_subject_problems_on_subject_id (cost=0.00..4.20 rows=6 width=0) (actual time=0.004..0.004 rows=6 loops=1)

  • Index Cond: (subject_problems.subject_id = 6,308,239)
  • Buffers: shared hit=1
14. 0.048 0.048 ↑ 1.0 1 6

Index Scan using subjects_pkey on public.subjects (cost=0.15..8.17 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=6)

  • Output: subjects.id, subjects.name, subjects.created_at, subjects.updated_at, subjects.creator_id, subjects.deleted_at, subjects.last_viewed_at, subjects.problems_count, subjects.topics_count, subjects.public, subjects.organization_id, subjects.description, subjects.demo, subjects.price_cents, subjects.price_currency, subjects.institution_id, subjects.slug
  • Index Cond: (subjects.id = 6,308,239)
  • Filter: (subjects.deleted_at IS NULL)
  • Buffers: shared hit=12
15. 0.012 0.018 ↓ 0.0 0 6

Bitmap Heap Scan on public.topic_problems (cost=1.53..10.02 rows=6 width=16) (actual time=0.003..0.003 rows=0 loops=6)

  • Output: topic_problems.id, topic_problems.problem_id, topic_problems.topic_id, topic_problems.created_at, topic_problems.updated_at
  • Recheck Cond: (topic_problems.problem_id = problems.id)
  • Buffers: shared hit=6
16. 0.006 0.006 ↓ 0.0 0 6

Bitmap Index Scan on index_topic_problems_on_problem_id (cost=0.00..1.53 rows=6 width=0) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: (topic_problems.problem_id = problems.id)
  • Buffers: shared hit=6
17. 0.012 0.012 ↓ 0.0 0 6

Index Only Scan using topics_pkey on public.topics (cost=0.15..0.20 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=6)

  • Output: topics.id
  • Index Cond: (topics.id = topic_problems.topic_id)
  • Heap Fetches: 0
Planning time : 0.762 ms
Execution time : 0.372 ms