explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aZZr

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 10.570 ↑ 1.0 5 1

Limit (cost=0.57..336.58 rows=5 width=1,103) (actual time=4.622..10.570 rows=5 loops=1)

2. 4.372 10.555 ↑ 37,508.4 5 1

Nested Loop Left Join (cost=0.57..12,603,228.73 rows=187,542 width=1,103) (actual time=4.620..10.555 rows=5 loops=1)

  • Join Filter: (news_video.news_id = news.id)
  • Rows Removed by Join Filter: 16,953
3. 0.034 0.338 ↑ 37,508.4 5 1

Nested Loop Left Join (cost=0.57..161,364.75 rows=187,542 width=1,045) (actual time=0.164..0.338 rows=5 loops=1)

4. 0.214 0.214 ↑ 37,508.4 5 1

Index Scan Backward using news_k_date on news (cost=0.42..130,873.19 rows=187,542 width=1,041) (actual time=0.149..0.214 rows=5 loops=1)

  • Index Cond: (date <= now())
  • Filter: ((id <> 761193) AND (notmain = 0))
5. 0.090 0.090 ↓ 0.0 0 5

Index Scan using comments_news_counts_pk on comments_news_counts news_comments_count (cost=0.14..0.16 rows=1 width=12) (actual time=0.018..0.018 rows=0 loops=5)

  • Index Cond: (news_id = news.id)
6. 3.692 5.460 ↑ 1.0 3,391 5

Materialize (cost=0.00..93.88 rows=3,392 width=54) (actual time=0.010..1.092 rows=3,391 loops=5)

7. 1.768 1.768 ↑ 1.0 3,392 1

Seq Scan on news_video (cost=0.00..76.92 rows=3,392 width=54) (actual time=0.032..1.768 rows=3,392 loops=1)

8.          

SubPlan (for Nested Loop Left Join)

9. 0.130 0.385 ↑ 45.0 1 5

Sort (cost=15.35..15.46 rows=45 width=36) (actual time=0.077..0.077 rows=1 loops=5)

  • Sort Key: i.i
  • Sort Method: quicksort Memory: 25kB
10. 0.134 0.255 ↑ 45.0 1 5

Hash Join (cost=1.21..14.11 rows=45 width=36) (actual time=0.049..0.051 rows=1 loops=5)

  • Hash Cond: ((news.category_ids)[i.i] = prop.id)
11. 0.095 0.095 ↑ 1,000.0 1 5

Function Scan on generate_subscripts i (cost=0.00..10.00 rows=1,000 width=4) (actual time=0.018..0.019 rows=1 loops=5)

12. 0.009 0.026 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=844) (actual time=0.025..0.026 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.017 0.017 ↑ 1.0 9 1

Seq Scan on categorys prop (cost=0.00..1.09 rows=9 width=844) (actual time=0.013..0.017 rows=9 loops=1)

Planning time : 1.614 ms
Execution time : 11.001 ms