explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yMmm : Optimization for: plan #mJPE

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.006 3,330.689 ↑ 1.0 1 1

Limit (cost=9,288.64..9,288.65 rows=1 width=26) (actual time=3,330.685..3,330.689 rows=1 loops=1)

2. 1.685 3,330.683 ↑ 4,460.0 1 1

Sort (cost=9,288.64..9,299.79 rows=4,460 width=26) (actual time=3,330.683..3,330.683 rows=1 loops=1)

  • Sort Key: abandoned_carts.scheduled_at DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 1.026 3,328.998 ↑ 7.3 611 1

Nested Loop (cost=1.41..9,266.34 rows=4,460 width=26) (actual time=16.654..3,328.998 rows=611 loops=1)

4. 37.495 2,703.453 ↑ 107.0 1 1

Nested Loop (cost=0.99..5,065.19 rows=107 width=28) (actual time=14.069..2,703.453 rows=1 loops=1)

  • Join Filter: ((products.uid)::text = ANY (regexp_split_to_array(btrim(regexp_replace(abandoned_carts.product_uids, '[\n\r''-]+'::text, ' '::text, 'g'::text)), '\D+'::text)))
  • Rows Removed by Join Filter: 2616
5. 921.521 921.521 ↑ 1.0 1 1

Index Scan using index_abandoned_carts_on_store_id on abandoned_carts (cost=0.43..2,517.53 rows=1 width=34) (actual time=6.575..921.521 rows=1 loops=1)

  • Index Cond: (store_id = 3420)
  • Filter: (((status)::text <> 'preview'::text) AND ((email)::text = 'fquahe@icloud.com'::text))
  • Rows Removed by Filter: 3859
6. 1,744.437 1,744.437 ↓ 1.2 2,617 1

Index Scan using index_products_on_store_id_and_uid on products (cost=0.56..2,471.11 rows=2,187 width=28) (actual time=5.698..1,744.437 rows=2,617 loops=1)

  • Index Cond: (store_id = 3420)
7. 624.519 624.519 ↓ 14.5 611 1

Index Scan using index_product_collections_on_uid on product_collections (cost=0.42..38.84 rows=42 width=26) (actual time=2.577..624.519 rows=611 loops=1)

  • Index Cond: ((uid)::text = ANY (products.category_uids))
Planning time : 0.593 ms
Execution time : 3,330.764 ms