explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bWvY

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 10.133 ↑ 1.0 30 1

Limit (cost=13.14..269.27 rows=30 width=135) (actual time=1.545..10.133 rows=30 loops=1)

2. 0.311 10.127 ↑ 16.7 30 1

Nested Loop (cost=13.14..4,299.08 rows=502 width=135) (actual time=1.545..10.127 rows=30 loops=1)

  • Join Filter: (u.rank = r.id)
  • Rows Removed by Join Filter: 464
3. 0.012 9.786 ↑ 16.7 30 1

Nested Loop (cost=13.14..4,168.60 rows=502 width=213) (actual time=1.514..9.786 rows=30 loops=1)

4. 0.015 9.624 ↑ 16.7 30 1

Nested Loop Left Join (cost=12.73..3,132.47 rows=502 width=113) (actual time=1.507..9.624 rows=30 loops=1)

  • Join Filter: (log.id = report.post)
5. 0.428 9.579 ↑ 16.7 30 1

Nested Loop Left Join (cost=12.44..3,071.34 rows=502 width=109) (actual time=1.471..9.579 rows=30 loops=1)

  • Join Filter: (log.id = l.post)
  • Rows Removed by Join Filter: 4139
6. 7.640 7.711 ↑ 16.7 30 1

Index Scan using idx_chatlog_created_id on chat_log log (cost=12.02..2,813.42 rows=502 width=105) (actual time=0.175..7.711 rows=30 loops=1)

  • Filter: ((NOT spam) AND (NOT (hashed SubPlan 1)) AND (room = 14))
  • Rows Removed by Filter: 6875
7.          

SubPlan (for Index Scan)

8. 0.071 0.071 ↑ 4.2 4 1

Index Only Scan using idx_blocklist_users on blocklist (cost=0.42..11.56 rows=17 width=4) (actual time=0.056..0.071 rows=4 loops=1)

  • Index Cond: (user_a = 702947)
  • Heap Fetches: 4
9. 0.217 1.440 ↓ 4.6 138 30

Materialize (cost=0.42..32.09 rows=30 width=8) (actual time=0.002..0.048 rows=138 loops=30)

10. 1.223 1.223 ↓ 4.6 138 1

Index Scan using like_user_post on "like" l (cost=0.42..31.94 rows=30 width=8) (actual time=0.047..1.223 rows=138 loops=1)

  • Index Cond: ("user" = 702947)
11. 0.000 0.030 ↓ 0.0 0 30

Materialize (cost=0.29..8.44 rows=7 width=8) (actual time=0.001..0.001 rows=0 loops=30)

12. 0.035 0.035 ↓ 0.0 0 1

Index Scan using idx_report_reporter on report (cost=0.29..8.40 rows=7 width=8) (actual time=0.035..0.035 rows=0 loops=1)

  • Index Cond: (reporter = 702947)
13. 0.150 0.150 ↑ 1.0 1 30

Index Scan using user_pkey on "user" u (cost=0.41..2.05 rows=1 width=104) (actual time=0.004..0.005 rows=1 loops=30)

  • Index Cond: (id = log."user")
14. 0.024 0.030 ↑ 1.1 16 30

Materialize (cost=0.00..1.25 rows=17 width=12) (actual time=0.000..0.001 rows=16 loops=30)

15. 0.006 0.006 ↑ 1.0 17 1

Seq Scan on user_rank r (cost=0.00..1.17 rows=17 width=12) (actual time=0.004..0.006 rows=17 loops=1)

Planning time : 1.368 ms
Execution time : 10.268 ms