explain.depesz.com

PostgreSQL's explain analyze made readable

Result: c2FK

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 1.650 ↓ 3.5 77 1

Limit (cost=391.79..391.84 rows=22 width=77) (actual time=1.628..1.650 rows=77 loops=1)

2. 0.136 1.637 ↓ 3.5 77 1

Sort (cost=391.79..391.84 rows=22 width=77) (actual time=1.627..1.637 rows=77 loops=1)

  • Sort Key: retailer_term_v2s.score DESC NULLS LAST, generic_term_v2s.score DESC NULLS LAST, ((((ts_rank(items_0.full_text_v2, '''water'''::tsquery, 1) * '100'::double precision) + (COALESCE(products_conversions.score, '0'::double precision) * '1000'::double precision)) * '1'::double precision)) DESC, items_0.item_id DESC
  • Sort Method: quicksort Memory: 35kB
3. 0.193 1.501 ↓ 3.5 77 1

WindowAgg (cost=90.62..391.30 rows=22 width=77) (actual time=1.375..1.501 rows=77 loops=1)

4. 0.066 1.308 ↓ 3.5 77 1

Nested Loop Left Join (cost=90.62..390.58 rows=22 width=413) (actual time=0.873..1.308 rows=77 loops=1)

  • Join Filter: (generic_term_v2s.product_id = items_0.product_id)
5. 0.048 1.242 ↓ 3.5 77 1

Nested Loop Left Join (cost=90.47..382.08 rows=22 width=409) (actual time=0.845..1.242 rows=77 loops=1)

  • Join Filter: ((retailer_term_v2s.product_id = items_0.product_id) AND (retailer_term_v2s.retailer_id = items_0.retailer_id))
6. 0.062 1.194 ↓ 3.5 77 1

Nested Loop Left Join (cost=86.28..367.47 rows=22 width=405) (actual time=0.833..1.194 rows=77 loops=1)

7. 0.042 0.978 ↓ 3.5 77 1

Nested Loop Left Join (cost=85.86..181.03 rows=22 width=397) (actual time=0.823..0.978 rows=77 loops=1)

  • Join Filter: ((items_availabilities.inventory_area_id = items_0.inventory_area_id) AND (items_availabilities.item_id = items_0.item_id))
8. 0.135 0.936 ↓ 3.5 77 1

Bitmap Heap Scan on items_0 (cost=81.65..163.97 rows=22 width=393) (actual time=0.817..0.936 rows=77 loops=1)

  • Recheck Cond: ((full_text_v2 @@ '''water'''::tsquery) AND (inventory_area_id = 20,636))
  • Filter: (visible AND available)
  • Heap Blocks: exact=73
9. 0.020 0.801 ↓ 0.0 0 1

BitmapAnd (cost=81.65..81.65 rows=22 width=0) (actual time=0.800..0.801 rows=0 loops=1)

10. 0.223 0.223 ↓ 1.1 167 1

Bitmap Index Scan on search_index_v2_items_0 (cost=0.00..21.46 rows=146 width=0) (actual time=0.223..0.223 rows=167 loops=1)

  • Index Cond: ((full_text_v2 @@ '''water'''::tsquery) AND (inventory_area_id = 20,636))
11. 0.558 0.558 ↓ 1.5 4,223 1

Bitmap Index Scan on items_0_available_visible_idx (cost=0.00..59.93 rows=2,764 width=0) (actual time=0.558..0.558 rows=4,223 loops=1)

  • Index Cond: ((available = true) AND (visible = true))
12. 0.000 0.000 ↓ 0.0 0 77

Materialize (cost=4.21..14.39 rows=7 width=20) (actual time=0.000..0.000 rows=0 loops=77)

13. 0.001 0.003 ↓ 0.0 0 1

Bitmap Heap Scan on items_availabilities_0 items_availabilities (cost=4.21..14.35 rows=7 width=20) (actual time=0.002..0.003 rows=0 loops=1)

  • Recheck Cond: (inventory_area_id = 20,636)
14. 0.002 0.002 ↓ 0.0 0 1

Bitmap Index Scan on items_availabilities_0_inventory_area_id_idx (cost=0.00..4.21 rows=7 width=0) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (inventory_area_id = 20,636)
15. 0.154 0.154 ↓ 0.0 0 77

Index Scan using index_products_conversions_on_cpk on products_conversions (cost=0.42..8.44 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=77)

  • Index Cond: ((version = 1) AND (product_id = items_0.product_id) AND ((query)::text = 'water'::text))
16. 0.000 0.000 ↓ 0.0 0 77

Materialize (cost=4.19..12.69 rows=5 width=16) (actual time=0.000..0.000 rows=0 loops=77)

17. 0.001 0.002 ↓ 0.0 0 1

Bitmap Heap Scan on retailer_products_term_v2s retailer_term_v2s (cost=4.19..12.66 rows=5 width=16) (actual time=0.002..0.002 rows=0 loops=1)

  • Recheck Cond: (term = 'water'::text)
18. 0.001 0.001 ↓ 0.0 0 1

Bitmap Index Scan on index_retailer_products_term_v2s_on_natural_key (cost=0.00..4.19 rows=5 width=0) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (term = 'water'::text)
19. 0.000 0.000 ↓ 0.0 0 77

Materialize (cost=0.15..8.18 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=77)

20. 0.026 0.026 ↓ 0.0 0 1

Index Scan using index_retailer_products_term_v2s_on_natural_key on retailer_products_term_v2s generic_term_v2s (cost=0.15..8.17 rows=1 width=12) (actual time=0.026..0.026 rows=0 loops=1)

  • Index Cond: ((term = 'water'::text) AND (retailer_id = '-1'::integer))
Planning time : 1.859 ms