explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nlNQ

Settings
# exclusive inclusive rows x rows loops node
1. 114.353 2,141.159 ↓ 1.2 714,482 1

Unique (cost=295,937.56..300,939.12 rows=579,090 width=33) (actual time=1,761.939..2,141.159 rows=714,482 loops=1)

2. 786.346 2,026.806 ↓ 1.0 1,000,348 1

Sort (cost=295,937.56..298,438.34 rows=1,000,313 width=33) (actual time=1,761.938..2,026.806 rows=1,000,348 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: 41040kB
3. 594.969 1,240.460 ↓ 1.0 1,000,348 1

Hash Left Join (cost=64,309.28..141,541.26 rows=1,000,313 width=33) (actual time=400.234..1,240.460 rows=1,000,348 loops=1)

  • Hash Cond: (outfit.id_outfit = outfit_ranking_temp_a.id_outfit)
4. 246.833 246.833 ↓ 1.0 1,000,348 1

Seq Scan on outfit (cost=0.00..48,213.13 rows=1,000,313 width=17) (actual time=0.018..246.833 rows=1,000,348 loops=1)

  • Filter: ((NOT private_flag) AND (deleted_at IS NULL))
5. 173.627 398.658 ↓ 1.0 910,000 1

Hash (cost=48,490.68..48,490.68 rows=909,968 width=16) (actual time=398.658..398.658 rows=910,000 loops=1)

  • Buckets: 131072 Batches: 16 Memory Usage: 3917kB
6. 225.031 225.031 ↓ 1.0 910,000 1

Seq Scan on outfit_ranking_temp_a (cost=0.00..48,490.68 rows=909,968 width=16) (actual time=0.050..225.031 rows=910,000 loops=1)

Planning time : 0.500 ms
Execution time : 2,201.973 ms