explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4EBY

Settings
# exclusive inclusive rows x rows loops node
1. 0.024 7,007.349 ↑ 1.0 50 1

Limit (cost=2.84..1,552.70 rows=50 width=436) (actual time=6,616.462..7,007.349 rows=50 loops=1)

2. 0.093 7,007.325 ↑ 1,096.1 50 1

Nested Loop Left Join (cost=2.84..1,698,741.44 rows=54,803 width=436) (actual time=6,616.460..7,007.325 rows=50 loops=1)

3. 0.076 7,007.082 ↑ 1,096.1 50 1

Nested Loop Left Join (cost=2.55..1,680,998.13 rows=54,803 width=414) (actual time=6,616.445..7,007.082 rows=50 loops=1)

4. 0.117 7,006.356 ↑ 1,096.1 50 1

Nested Loop Left Join (cost=2.13..1,587,894.91 rows=54,803 width=385) (actual time=6,616.429..7,006.356 rows=50 loops=1)

5. 0.108 7,006.039 ↑ 1,096.1 50 1

Nested Loop Left Join (cost=1.70..1,500,733.08 rows=54,803 width=352) (actual time=6,616.417..7,006.039 rows=50 loops=1)

6. 0.118 7,005.631 ↑ 1,096.1 50 1

Nested Loop Left Join (cost=1.28..1,475,569.05 rows=54,803 width=336) (actual time=6,616.402..7,005.631 rows=50 loops=1)

7. 644.713 7,005.213 ↑ 1,096.1 50 1

Nested Loop (cost=0.85..1,442,699.97 rows=54,803 width=299) (actual time=6,616.383..7,005.213 rows=50 loops=1)

8. 3,354.386 3,354.386 ↑ 2.1 1,002,038 1

Index Scan using idx_741762_primary on user_topics (cost=0.43..391,864.12 rows=2,137,854 width=261) (actual time=0.021..3,354.386 rows=1,002,038 loops=1)

  • Filter: (NOT is_archived)
  • Rows Removed by Filter: 1,919,943
9. 3,006.114 3,006.114 ↓ 0.0 0 1,002,038

Index Scan using idx_741710_primary on users "user" (cost=0.42..0.49 rows=1 width=46) (actual time=0.003..0.003 rows=0 loops=1,002,038)

  • Index Cond: (id = user_topics.user_id)
  • Filter: (organisation_id = 2,697)
  • Rows Removed by Filter: 1
10. 0.300 0.300 ↑ 1.0 1 50

Index Scan using idx_741672_primary on topic_versions "topicVersion" (cost=0.42..0.60 rows=1 width=45) (actual time=0.006..0.006 rows=1 loops=50)

  • Index Cond: (id = user_topics.topic_version_id)
11. 0.300 0.300 ↑ 1.0 1 50

Index Scan using idx_741655_primary on topics topic (cost=0.42..0.46 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=50)

  • Index Cond: (id = user_topics.topic_id)
12. 0.200 0.200 ↑ 1.0 1 50

Index Scan using idx_741672_primary on topic_versions "topic:currentTopicVersion" (cost=0.42..1.59 rows=1 width=45) (actual time=0.004..0.004 rows=1 loops=50)

  • Index Cond: (id = topic.production_topic_version_id)
13. 0.650 0.650 ↑ 2.0 1 50

Index Scan using idx_741672_topic_id on topic_versions (cost=0.42..1.68 rows=2 width=45) (actual time=0.008..0.013 rows=1 loops=50)

  • Index Cond: (topic_id = topic.id)
  • Filter: ((status)::text = 'DRAFT'::text)
  • Rows Removed by Filter: 6
14. 0.150 0.150 ↓ 0.0 0 50

Index Scan using idx_741371_primary on courses "topic:theme" (cost=0.29..0.32 rows=1 width=34) (actual time=0.003..0.003 rows=0 loops=50)

  • Index Cond: (id = topic.theme_id)
Planning time : 5.716 ms
Execution time : 7,007.499 ms