explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aCP6 : Optimization for: plan #To5M

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.001 0.029 ↓ 0.0 0 1

Limit (cost=86.99..87.12 rows=51 width=613) (actual time=0.029..0.029 rows=0 loops=1)

2.          

CTE outfits

3. 0.000 0.000 ↓ 0.0 0

Unique (cost=32.52..32.93 rows=13 width=33) (never executed)

4. 0.000 0.000 ↓ 0.0 0

Sort (cost=32.52..32.73 rows=82 width=33) (never executed)

  • 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
5. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=14.83..29.91 rows=82 width=33) (never executed)

  • Hash Cond: (outfit_ranking_temp_a.id_outfit = outfit.id_outfit)
6. 0.000 0.000 ↓ 0.0 0

Seq Scan on outfit_ranking_temp_a (cost=0.00..13.20 rows=320 width=16) (never executed)

7. 0.000 0.000 ↓ 0.0 0

Hash (cost=13.80..13.80 rows=82 width=17) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Seq Scan on outfit (cost=0.00..13.80 rows=82 width=17) (never executed)

  • Filter: ((NOT private_flag) AND (deleted_at IS NULL))
9. 0.019 0.028 ↓ 0.0 0 1

Sort (cost=54.06..55.95 rows=754 width=613) (actual time=0.028..0.028 rows=0 loops=1)

  • Sort Key: user_ranking_temp_a.follower_count_at_week DESC, user_ranking_temp_a.outfit_star_count_at_week DESC, (COALESCE(user_ranking_temp_a.outfit_post_updated_at, '1970-07-16 00:00:00'::timestamp without time zone)) DESC
  • Sort Method: quicksort Memory: 25kB
10. 0.002 0.009 ↓ 0.0 0 1

Nested Loop (cost=0.14..28.91 rows=754 width=613) (actual time=0.009..0.009 rows=0 loops=1)

11. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on user_app (cost=0.00..10.90 rows=58 width=73) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: (deleted_at IS NULL)
12. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.14..8.62 rows=13 width=540) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.14..8.55 rows=13 width=540) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Index Scan using user_ranking_temp_a_id_user_app_key on user_ranking_temp_a (cost=0.14..8.16 rows=1 width=532) (never executed)

  • Index Cond: (id_user_app = 42)
15. 0.000 0.000 ↓ 0.0 0

CTE Scan on outfits (cost=0.00..0.26 rows=13 width=8) (never executed)