explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QtOA

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 12.968 ↑ 1.0 10 1

Limit (cost=3,064.57..3,064.59 rows=10 width=12) (actual time=12.966..12.968 rows=10 loops=1)

  • Buffers: shared hit=1207
2. 0.155 12.965 ↑ 54.0 10 1

Sort (cost=3,064.57..3,065.92 rows=540 width=12) (actual time=12.965..12.965 rows=10 loops=1)

  • Sort Key: ((SubPlan 1)) DESC
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=1207
3. 0.654 12.810 ↓ 1.1 600 1

HashAggregate (cost=16.75..3,052.90 rows=540 width=12) (actual time=0.351..12.810 rows=600 loops=1)

  • Group Key: v.video_id
  • Buffers: shared hit=1204
4. 0.156 0.156 ↓ 1.1 600 1

Seq Scan on video v (cost=0.00..15.40 rows=540 width=4) (actual time=0.035..0.156 rows=600 loops=1)

  • Buffers: shared hit=4
5.          

SubPlan (forHashAggregate)

6. 1.200 12.000 ↑ 1.0 1 600

Aggregate (cost=5.60..5.61 rows=1 width=8) (actual time=0.020..0.020 rows=1 loops=600)

  • Buffers: shared hit=1200
7. 10.800 10.800 ↓ 0.0 0 600

Seq Scan on likes l (cost=0.00..5.60 rows=1 width=4) (actual time=0.015..0.018 rows=0 loops=600)

  • Filter: ((user_id <> 10) AND (video_id = v.video_id))
  • Rows Removed by Filter: 240
  • Buffers: shared hit=1200