explain.depesz.com

PostgreSQL's explain analyze made readable

Result: x21E

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 15.978 ↑ 1.0 20 1

Limit (cost=2.15..1,409.39 rows=20 width=1,353) (actual time=3.296..15.978 rows=20 loops=1)

2. 0.025 15.974 ↑ 10,910.9 20 1

Nested Loop Left Join (cost=2.15..15,354,311.01 rows=218,218 width=1,353) (actual time=3.295..15.974 rows=20 loops=1)

3. 0.029 15.749 ↑ 10,910.9 20 1

Nested Loop Left Join (cost=1.71..13,522,374.95 rows=218,218 width=1,248) (actual time=3.275..15.749 rows=20 loops=1)

4. 0.025 15.620 ↑ 10,910.9 20 1

Nested Loop (cost=1.30..11,696,166.04 rows=218,218 width=1,118) (actual time=3.265..15.620 rows=20 loops=1)

5. 0.035 15.415 ↑ 10,910.9 20 1

Nested Loop (cost=0.87..9,866,735.31 rows=218,218 width=277) (actual time=3.251..15.415 rows=20 loops=1)

6. 15.200 15.200 ↑ 10,910.9 20 1

Index Scan using reviews_rating_votes on reviews_review (cost=0.43..8,035,757.48 rows=218,218 width=136) (actual time=3.236..15.200 rows=20 loops=1)

  • Filter: ((partner_id IS NULL) AND (comment IS NOT NULL) AND ((NOT is_livelib) OR (is_livelib IS NULL)) AND (comment <> ''::text) AND (show OR (user_id = 7963)))
  • Rows Removed by Filter: 8408
7. 0.180 0.180 ↑ 1.0 1 20

Index Scan using auth_user_pkey on auth_user (cost=0.43..8.38 rows=1 width=141) (actual time=0.009..0.009 rows=1 loops=20)

  • Index Cond: (id = reviews_review.user_id)
8. 0.180 0.180 ↑ 1.0 1 20

Index Scan using idx_books_book_active_activated_at on books_book (cost=0.43..8.37 rows=1 width=841) (actual time=0.008..0.009 rows=1 loops=20)

  • Index Cond: (id = reviews_review.book_id)
9. 0.100 0.100 ↑ 1.0 1 20

Index Scan using authors_author_pkey on authors_author (cost=0.42..8.36 rows=1 width=134) (actual time=0.004..0.005 rows=1 loops=20)

  • Index Cond: (books_book.main_author_id = id)
10. 0.200 0.200 ↑ 1.0 1 20

Index Scan using account_userprofile_user_id_key on account_userprofile (cost=0.43..8.38 rows=1 width=105) (actual time=0.009..0.010 rows=1 loops=20)

  • Index Cond: (auth_user.id = user_id)