explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2WL8

Settings
# exclusive inclusive rows x rows loops node
1. 0.902 21,404.150 ↓ 11.6 511 1

Nested Loop (cost=636.10..5,741,400.39 rows=44 width=100) (actual time=61.180..21,404.150 rows=511 loops=1)

2. 0.953 21,124.944 ↓ 1.8 208 1

Nested Loop (cost=0.84..25,980.12 rows=113 width=37) (actual time=61.138..21,124.944 rows=208 loops=1)

3. 85.223 85.223 ↓ 214.0 214 1

Index Scan using restaurants_geometry_to_geography_index on restaurants (cost=0.28..8.68 rows=1 width=37) (actual time=0.514..85.223 rows=214 loops=1)

  • Index Cond: ((geometry)::geography && '0101000020E610000062BA10AB3F905DC05F7EA7C98C054140'::geography)
  • Filter: (('0101000020E610000062BA10AB3F905DC05F7EA7C98C054140'::geography && _st_expand((geometry)::geography, '1100'::double precision)) AND _st_dwithin((geometry)::geography, '0101000020E610000062BA10AB3F905DC05F7EA7C98C054140'::geography, '1100'::double precision, true))
  • Rows Removed by Filter: 31
4. 2,289.013 21,038.768 ↑ 649.0 1 214

Index Scan using item_combinations_restaurant_id_index on item_combinations (cost=0.56..25,964.95 rows=649 width=74) (actual time=83.309..98.312 rows=1 loops=214)

  • Index Cond: (restaurant_id = restaurants.restaurant_id)
  • Filter: (((SubPlan 1) AND (SubPlan 2) AND (SubPlan 3)) OR ((SubPlan 4) AND (SubPlan 5)))
  • Rows Removed by Filter: 145
5.          

SubPlan (forIndex Scan)

6. 16,944.661 16,944.661 ↓ 0.0 0 31,321

Index Only Scan using item_combinations_index_pkey on item_combinations_index item_combinations_index_1 (cost=0.70..6.15 rows=144 width=0) (actual time=0.541..0.541 rows=0 loops=31,321)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'cheese'::text))
  • Heap Fetches: 0
7. 185.696 185.696 ↓ 0.0 0 6,632

Index Only Scan using item_combinations_index_pkey on item_combinations_index item_combinations_index_2 (cost=0.70..5.20 rows=49 width=0) (actual time=0.028..0.028 rows=0 loops=6,632)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'bacon'::text))
  • Heap Fetches: 0
8. 9.240 9.240 ↓ 0.0 0 924

Index Only Scan using item_combinations_index_pkey on item_combinations_index item_combinations_index_3 (cost=0.70..4.73 rows=2 width=0) (actual time=0.010..0.010 rows=0 loops=924)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'burger'::text))
  • Heap Fetches: 0
9. 1,592.526 1,592.526 ↓ 0.0 0 31,226

Index Only Scan using item_combinations_index_pkey on item_combinations_index item_combinations_index_4 (cost=0.70..4.73 rows=2 width=0) (actual time=0.051..0.051 rows=0 loops=31,226)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'mango'::text))
  • Heap Fetches: 0
10. 17.632 17.632 ↓ 0.0 0 464

Index Only Scan using item_combinations_index_pkey on item_combinations_index item_combinations_index_5 (cost=0.70..4.73 rows=2 width=0) (actual time=0.038..0.038 rows=0 loops=464)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'smoothie'::text))
  • Heap Fetches: 0
11. 83.616 278.304 ↑ 99.0 2 208

Bitmap Heap Scan on item_combinations_index (cost=635.26..50,576.96 rows=198 width=100) (actual time=1.254..1.338 rows=2 loops=208)

  • Recheck Cond: (item_combination_id = item_combinations.combination_id)
  • Filter: ((key = 'cheese'::text) OR (key = 'bacon'::text) OR (key = 'burger'::text) OR (key = 'mango'::text) OR (key = 'smoothie'::text))
  • Rows Removed by Filter: 25
  • Heap Blocks: exact=317
12. 194.688 194.688 ↑ 469.1 28 208

Bitmap Index Scan on item_combinations_index_comb_id_idx (cost=0.00..635.21 rows=13,134 width=0) (actual time=0.936..0.936 rows=28 loops=208)

  • Index Cond: (item_combination_id = item_combinations.combination_id)