explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HI81

Settings
# exclusive inclusive rows x rows loops node
1. 0.341 303.595 ↓ 7.7 340 1

Nested Loop (cost=636.10..5,741,400.39 rows=44 width=100) (actual time=57.042..303.595 rows=340 loops=1)

2. 0.130 299.919 ↓ 1.0 115 1

Nested Loop (cost=0.84..25,980.12 rows=113 width=37) (actual time=56.990..299.919 rows=115 loops=1)

3. 0.858 0.858 ↓ 41.0 41 1

Index Scan using restaurants_geometry_to_geography_index on restaurants (cost=0.28..8.68 rows=1 width=37) (actual time=0.211..0.858 rows=41 loops=1)

  • Index Cond: ((geometry)::geography && '0101000020E610000043209738F29E5DC0888043A852014140'::geography)
  • Filter: (('0101000020E610000043209738F29E5DC0888043A852014140'::geography && _st_expand((geometry)::geography, '1100'::double precision)) AND _st_dwithin((geometry)::geography, '0101000020E610000043209738F29E5DC0888043A852014140'::geography, '1100'::double precision, true))
  • Rows Removed by Filter: 64
4. 26.934 298.931 ↑ 216.3 3 41

Index Scan using item_combinations_restaurant_id_index on item_combinations (cost=0.56..25,964.95 rows=649 width=74) (actual time=6.356..7.291 rows=3 loops=41)

  • 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: 275
5.          

SubPlan (for Index Scan)

6. 136.812 136.812 ↓ 0.0 0 11,401

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.012..0.012 rows=0 loops=11,401)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'cheese'::text))
  • Heap Fetches: 0
7. 25.785 25.785 ↓ 0.0 0 2,865

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.009..0.009 rows=0 loops=2,865)

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

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.009..0.009 rows=0 loops=549)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'burger'::text))
  • Heap Fetches: 0
9. 101.619 101.619 ↓ 0.0 0 11,291

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.009..0.009 rows=0 loops=11,291)

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

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.010..0.010 rows=0 loops=284)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'smoothie'::text))
  • Heap Fetches: 0
11. 1.380 3.335 ↑ 66.0 3 115

Bitmap Heap Scan on item_combinations_index (cost=635.26..50,576.96 rows=198 width=100) (actual time=0.024..0.029 rows=3 loops=115)

  • 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: 44
  • Heap Blocks: exact=218
12. 1.955 1.955 ↑ 279.4 47 115

Bitmap Index Scan on item_combinations_index_comb_id_idx (cost=0.00..635.21 rows=13,134 width=0) (actual time=0.017..0.017 rows=47 loops=115)

  • Index Cond: (item_combination_id = item_combinations.combination_id)
Planning time : 1.292 ms
Execution time : 303.744 ms