explain.depesz.com

PostgreSQL's explain analyze made readable

Result: piJ4

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 7,296.381 ↑ 1.0 50 1

Limit (cost=2.84..1,569.97 rows=50 width=437) (actual time=6,819.419..7,296.381 rows=50 loops=1)

2. 0.117 7,296.354 ↑ 1,082.7 50 1

Nested Loop Left Join (cost=2.84..1,696,726.39 rows=54,135 width=437) (actual time=6,819.418..7,296.354 rows=50 loops=1)

3. 0.110 7,296.087 ↑ 1,082.7 50 1

Nested Loop Left Join (cost=2.55..1,679,199.36 rows=54,135 width=415) (actual time=6,819.403..7,296.087 rows=50 loops=1)

4. 0.128 7,295.327 ↑ 1,082.7 50 1

Nested Loop Left Join (cost=2.13..1,587,230.99 rows=54,135 width=386) (actual time=6,819.387..7,295.327 rows=50 loops=1)

5. 0.086 7,294.999 ↑ 1,082.7 50 1

Nested Loop Left Join (cost=1.70..1,501,131.59 rows=54,135 width=353) (actual time=6,819.373..7,294.999 rows=50 loops=1)

6. 0.144 7,294.563 ↑ 1,082.7 50 1

Nested Loop Left Join (cost=1.28..1,476,275.19 rows=54,135 width=337) (actual time=6,819.359..7,294.563 rows=50 loops=1)

7. 819.104 7,294.119 ↑ 1,082.7 50 1

Nested Loop (cost=0.85..1,443,814.21 rows=54,135 width=300) (actual time=6,819.339..7,294.119 rows=50 loops=1)

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

Index Scan using idx_741762_primary on user_topics (cost=0.43..392,149.12 rows=2,139,728 width=261) (actual time=0.019..3,468.901 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=47) (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.350 0.350 ↑ 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.007..0.007 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.009..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,296.526 ms