explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WDF1

Settings
# exclusive inclusive rows x rows loops node
1. 0.047 73.748 ↓ 1.3 58 1

Nested Loop (cost=636.10..5,741,400.39 rows=44 width=100) (actual time=31.940..73.748 rows=58 loops=1)

2. 0.027 73.172 ↑ 4.9 23 1

Nested Loop (cost=0.84..25,980.12 rows=113 width=37) (actual time=31.908..73.172 rows=23 loops=1)

3. 0.296 0.296 ↓ 7.0 7 1

Index Scan using restaurants_geometry_to_geography_index on restaurants (cost=0.28..8.68 rows=1 width=37) (actual time=0.200..0.296 rows=7 loops=1)

  • Index Cond: ((geometry)::geography && '0101000020E6100000116F9D7FBB975DC045F5D6C056F14040'::geography)
  • Filter: (('0101000020E6100000116F9D7FBB975DC045F5D6C056F14040'::geography && _st_expand((geometry)::geography, '1100'::double precision)) AND _st_dwithin((geometry)::geography, '0101000020E6100000116F9D7FBB975DC045F5D6C056F14040'::geography, '1100'::double precision, true))
  • Rows Removed by Filter: 4
4. 3.741 72.849 ↑ 216.3 3 7

Index Scan using item_combinations_restaurant_id_index on item_combinations (cost=0.56..25,964.95 rows=649 width=74) (actual time=10.141..10.407 rows=3 loops=7)

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

SubPlan (forIndex Scan)

6. 38.584 38.584 ↓ 0.0 0 2,968

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.013..0.013 rows=0 loops=2,968)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'cheese'::text))
  • Heap Fetches: 0
7. 3.370 3.370 ↓ 0.0 0 337

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

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'bacon'::text))
  • Heap Fetches: 0
8. 0.170 0.170 ↑ 2.0 1 17

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=1 loops=17)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'burger'::text))
  • Heap Fetches: 0
9. 26.604 26.604 ↓ 0.0 0 2,956

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=2,956)

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

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=38)

  • Index Cond: ((item_combination_id = item_combinations.combination_id) AND (key = 'smoothie'::text))
  • Heap Fetches: 0
11. 0.184 0.529 ↑ 66.0 3 23

Bitmap Heap Scan on item_combinations_index (cost=635.26..50,576.96 rows=198 width=100) (actual time=0.020..0.023 rows=3 loops=23)

  • 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: 19
  • Heap Blocks: exact=30
12. 0.345 0.345 ↑ 625.4 21 23

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=21 loops=23)

  • Index Cond: (item_combination_id = item_combinations.combination_id)
Planning time : 1.361 ms
Execution time : 73.851 ms