explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Smxq

Settings
# exclusive inclusive rows x rows loops node
1. 2.752 810.284 ↓ 2.0 5,797 1

Nested Loop (cost=639.34..5,737,831.73 rows=2,931 width=100) (actual time=57.564..810.284 rows=5,797 loops=1)

2. 0.310 802.332 ↓ 1.8 208 1

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

3. 1.662 1.662 ↓ 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.228..1.662 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. 70.830 800.360 ↑ 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=3.106..3.740 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. 375.852 375.852 ↓ 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.012..0.012 rows=0 loops=31,321)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'cheese'::text))
  • Heap Fetches: 0
7. 59.688 59.688 ↓ 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.009..0.009 rows=0 loops=6,632)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'bacon'::text))
  • Heap Fetches: 0
8. 8.316 8.316 ↓ 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.009..0.009 rows=0 loops=924)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'burger'::text))
  • Heap Fetches: 0
9. 281.034 281.034 ↓ 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.009..0.009 rows=0 loops=31,226)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'mango'::text))
  • Heap Fetches: 0
10. 4.640 4.640 ↓ 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.010..0.010 rows=0 loops=464)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'smoothie'::text))
  • Heap Fetches: 0
11. 2.080 5.200 ↑ 469.1 28 208

Bitmap Heap Scan on item_combinations_index (cost=638.49..50,416.02 rows=13,134 width=100) (actual time=0.019..0.025 rows=28 loops=208)

  • Recheck Cond: (item_combination_id = item_combinations.combination_id)
  • Heap Blocks: exact=317
12. 3.120 3.120 ↑ 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.015..0.015 rows=28 loops=208)

  • Index Cond: (item_combination_id = item_combinations.combination_id)
Planning time : 1.231 ms
Execution time : 811.409 ms