explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pJRP

Settings
# exclusive inclusive rows x rows loops node
1. 26.551 2,627.827 ↓ 3.8 994 1

Unique (cost=236,561.18..238,790.67 rows=265 width=33) (actual time=2,206.630..2,627.827 rows=994 loops=1)

2. 1,116.096 2,601.276 ↓ 1.0 450,662 1

Sort (cost=236,561.18..237,675.92 rows=445,899 width=33) (actual time=2,206.629..2,601.276 rows=450,662 loops=1)

  • Sort Key: outfit.id_user_app, (COALESCE(outfit_ranking_temp_a.star_count_at_week, 0)) DESC, (COALESCE(outfit_ranking_temp_a.outfit_post_datetime, '1970-07-16 00:00:00'::timestamp without time zone)) DESC
  • Sort Method: external merge Disk: 18,472kB
3. 541.376 1,485.180 ↓ 1.0 450,662 1

Hash Join (cost=63,602.70..182,527.67 rows=445,899 width=33) (actual time=543.526..1,485.180 rows=450,662 loops=1)

  • Hash Cond: (outfit.id_outfit = outfit_ranking_temp_a.id_outfit)
4. 400.799 400.799 ↑ 2.0 500,747 1

Seq Scan on outfit (cost=0.00..94,817.42 rows=986,016 width=17) (actual time=0.012..400.799 rows=500,747 loops=1)

  • Filter: ((NOT private_flag) AND (deleted_at IS NULL))
  • Rows Removed by Filter: 499,253
5. 210.279 543.005 ↓ 1.0 900,000 1

Hash (cost=47,958.98..47,958.98 rows=899,898 width=16) (actual time=543.005..543.005 rows=900,000 loops=1)

  • Buckets: 131,072 Batches: 16 Memory Usage: 3,888kB
6. 332.726 332.726 ↓ 1.0 900,000 1

Seq Scan on outfit_ranking_temp_a (cost=0.00..47,958.98 rows=899,898 width=16) (actual time=0.010..332.726 rows=900,000 loops=1)

  • Filter: (id_outfit IS NOT NULL)
Planning time : 0.217 ms
Execution time : 2,631.864 ms