explain.depesz.com

PostgreSQL's explain analyze made readable

Result: d1lg

Settings
# exclusive inclusive rows x rows loops node
1. 0.057 5.821 ↓ 40.0 40 1

Unique (cost=205.87..205.87 rows=1 width=69) (actual time=5.721..5.821 rows=40 loops=1)

2. 0.295 5.764 ↓ 400.0 400 1

Sort (cost=205.87..205.87 rows=1 width=69) (actual time=5.720..5.764 rows=400 loops=1)

  • Sort Key: recipes.ms_recipe_id
  • Sort Method: quicksort Memory: 120kB
3. 0.408 5.469 ↓ 400.0 400 1

Nested Loop (cost=0.86..205.86 rows=1 width=69) (actual time=2.209..5.469 rows=400 loops=1)

4. 0.486 3.661 ↓ 200.0 200 1

Nested Loop (cost=0.58..203.79 rows=1 width=73) (actual time=2.188..3.661 rows=200 loops=1)

  • Join Filter: (((recipe_indexes.week)::double precision = date_part('week'::text, (recipe_delivery_dates.delivery_date)::timestamp without time zone)) AND ((recipe_indexes.year)::double precision = date_part('year'::text, (recipe_delivery_dates.delivery_date)::timestamp without time zone)))
  • Rows Removed by Join Filter: 220
5. 0.044 2.815 ↓ 20.0 40 1

Nested Loop (cost=0.29..202.22 rows=2 width=81) (actual time=2.167..2.815 rows=40 loops=1)

6. 2.571 2.571 ↓ 3.6 40 1

Seq Scan on recipe_indexes (cost=0.00..196.53 rows=11 width=19) (actual time=2.150..2.571 rows=40 loops=1)

  • Filter: ((country = 'us'::text) AND (week = 1) AND (year = 2019))
  • Rows Removed by Filter: 11954
7. 0.200 0.200 ↑ 1.0 1 40

Index Scan using recipes_ms_recipe_id_index on recipes (cost=0.29..0.51 rows=1 width=68) (actual time=0.004..0.005 rows=1 loops=40)

  • Index Cond: (ms_recipe_id = recipe_indexes.ms_recipe_id)
  • Filter: (country = 'us'::text)
8. 0.360 0.360 ↓ 1.1 10 40

Index Scan using recipe_delivery_dates_ms_recipe_id_index on recipe_delivery_dates (cost=0.29..0.52 rows=9 width=8) (actual time=0.004..0.009 rows=10 loops=40)

  • Index Cond: (ms_recipe_id = recipes.ms_recipe_id)
9. 1.400 1.400 ↓ 2.0 2 200

Index Scan using production_dates_delivery_date_index on production_dates (cost=0.29..2.05 rows=1 width=4) (actual time=0.005..0.007 rows=2 loops=200)

  • Index Cond: ((delivery_date = recipe_delivery_dates.delivery_date) AND (delivery_date = ANY ('{2018-12-31,2019-01-01,2019-01-02,2019-01-03,2019-01-04,2019-01-05,2019-01-06}'::date[])))
  • Filter: (fc_country = 'us'::text)
  • Rows Removed by Filter: 5