explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Bz5

Settings
# exclusive inclusive rows x rows loops node
1. 1.092 27.691 ↑ 1.6 1,207 1

Sort (cost=2,759.92..2,764.64 rows=1,888 width=311) (actual time=27.567..27.691 rows=1,207 loops=1)

  • Sort Key: user_topics.id
  • Sort Method: quicksort Memory: 519kB
2. 0.347 26.599 ↑ 1.6 1,207 1

Merge Join (cost=1.98..2,657.19 rows=1,888 width=311) (actual time=0.046..26.599 rows=1,207 loops=1)

  • Merge Cond: (topic.theme_id = "topic:theme".id)
3. 0.378 26.148 ↑ 1.6 1,208 1

Nested Loop (cost=1.70..17,302.06 rows=1,888 width=304) (actual time=0.037..26.148 rows=1,208 loops=1)

4. 17.196 24.542 ↑ 1.5 1,228 1

Nested Loop (cost=1.42..14,660.36 rows=1,888 width=296) (actual time=0.032..24.542 rows=1,228 loops=1)

5. 0.520 6.118 ↑ 1.5 1,228 1

Nested Loop (cost=1.14..12,146.20 rows=1,888 width=262) (actual time=0.026..6.118 rows=1,228 loops=1)

  • Join Filter: (topic.id = topic_versions.topic_id)
6. 0.197 2.503 ↑ 3.2 619 1

Nested Loop (cost=0.85..9,367.54 rows=2,000 width=258) (actual time=0.020..2.503 rows=619 loops=1)

7. 0.386 1.501 ↑ 4.1 805 1

Nested Loop (cost=0.57..5,269.35 rows=3,313 width=246) (actual time=0.014..1.501 rows=805 loops=1)

8. 0.177 0.177 ↑ 6.0 469 1

Index Scan using topics_theme_id_index on topics topic (cost=0.28..213.46 rows=2,823 width=16) (actual time=0.006..0.177 rows=469 loops=1)

9. 0.938 0.938 ↑ 3.0 2 469

Index Scan using idx_16882_topic_id on user_topics (cost=0.29..1.73 rows=6 width=230) (actual time=0.001..0.002 rows=2 loops=469)

  • Index Cond: (topic_id = topic.id)
  • Filter: (NOT is_archived)
  • Rows Removed by Filter: 1
10. 0.805 0.805 ↑ 1.0 1 805

Index Scan using idx_16780_primary on topic_versions "topicVersion" (cost=0.29..1.24 rows=1 width=20) (actual time=0.001..0.001 rows=1 loops=805)

  • Index Cond: (id = user_topics.topic_version_id)
11. 3.095 3.095 ↑ 1.0 2 619

Index Scan using idx_16780_topic_id on topic_versions (cost=0.29..1.36 rows=2 width=20) (actual time=0.002..0.005 rows=2 loops=619)

  • Index Cond: (topic_id = user_topics.topic_id)
  • Filter: ((status)::text = 'DRAFT'::text)
  • Rows Removed by Filter: 10
12. 1.228 1.228 ↑ 1.0 1 1,228

Index Scan using idx_16818_primary on users "user" (cost=0.28..1.33 rows=1 width=42) (actual time=0.001..0.001 rows=1 loops=1,228)

  • Index Cond: (id = user_topics.user_id)
13. 1.228 1.228 ↑ 1.0 1 1,228

Index Scan using idx_16780_primary on topic_versions "topic:currentTopicVersion" (cost=0.29..1.40 rows=1 width=20) (actual time=0.001..0.001 rows=1 loops=1,228)

  • Index Cond: (id = topic.production_topic_version_id)
14. 0.104 0.104 ↑ 1.1 665 1

Index Scan using idx_16481_primary on courses "topic:theme" (cost=0.28..38.36 rows=699 width=19) (actual time=0.007..0.104 rows=665 loops=1)

Planning time : 1.433 ms
Execution time : 27.853 ms