explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M4f

Settings
# exclusive inclusive rows x rows loops node
1. 9.996 207.946 ↓ 325.0 325 1

GroupAggregate (cost=1,260.30..1,260.31 rows=1 width=100) (actual time=197.561..207.946 rows=325 loops=1)

  • Group Key: m.seller_id, p.marketplace_id, (CASE product.parent_asin WHEN '<NoParent>'::text THEN product.asin ELSE product.parent_asin END)
2. 7.749 197.950 ↓ 6,953.0 6,953 1

Sort (cost=1,260.30..1,260.30 rows=1 width=96) (actual time=197.506..197.950 rows=6,953 loops=1)

  • Sort Key: (CASE product.parent_asin WHEN '<NoParent>'::text THEN product.asin ELSE product.parent_asin END)
  • Sort Method: quicksort Memory: 1170kB
3. 3.265 190.201 ↓ 6,953.0 6,953 1

Nested Loop (cost=0.51..1,260.30 rows=1 width=96) (actual time=7.061..190.201 rows=6,953 loops=1)

4. 9.222 159.591 ↓ 9,115.0 9,115 1

Nested Loop (cost=0.43..1,260.20 rows=1 width=118) (actual time=7.044..159.591 rows=9,115 loops=1)

5. 0.400 57.723 ↓ 10,294.0 10,294 1

Nested Loop (cost=0.31..1,260.00 rows=1 width=112) (actual time=0.088..57.723 rows=10,294 loops=1)

6. 3.381 14.192 ↓ 3.1 14,377 1

Nested Loop (cost=0.23..822.79 rows=4,615 width=76) (actual time=0.074..14.192 rows=14,377 loops=1)

7. 0.005 0.062 ↑ 1.0 1 1

Nested Loop (cost=0.12..8.13 rows=1 width=36) (actual time=0.059..0.062 rows=1 loops=1)

8. 0.027 0.027 ↑ 1.0 1 1

Index Scan using seller_id_unique on merchants m (cost=0.06..4.06 rows=1 width=18) (actual time=0.026..0.027 rows=1 loops=1)

  • Index Cond: ((seller_id)::text = 'A1LMQBEOGTEVAC'::text)
9. 0.030 0.030 ↑ 1.0 1 1

Index Scan using profiles_merchant_id_index on profiles p (cost=0.06..4.06 rows=1 width=30) (actual time=0.029..0.030 rows=1 loops=1)

  • Index Cond: (merchant_id = m.id)
  • Filter: ((marketplace_id)::text = 'ATVPDKIKX0DER'::text)
  • Rows Removed by Filter: 1
10. 10.749 10.749 ↑ 3.0 14,377 1

Index Scan using product_ads_profile_sku_campaigns_idx on product_ads pa (cost=0.11..686.49 rows=42,724 width=40) (actual time=0.012..10.749 rows=14,377 loops=1)

  • Index Cond: (profile_id = p.id)
11. 43.131 43.131 ↑ 1.0 1 14,377

Index Scan using campaigns_pkey on campaigns c2 (cost=0.09..0.09 rows=1 width=44) (actual time=0.003..0.003 rows=1 loops=14,377)

  • Index Cond: (id = pa.campaign_id)
  • Filter: (((state)::text = 'enabled'::text) AND (pa.profile_id = profile_id))
  • Rows Removed by Filter: 0
12. 92.646 92.646 ↑ 1.0 1 10,294

Index Scan using products_seller_marketplace_sku_unique on products product (cost=0.11..0.20 rows=1 width=66) (actual time=0.009..0.009 rows=1 loops=10,294)

  • Index Cond: (((seller_id)::text = 'A1LMQBEOGTEVAC'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text) AND ((sku)::text = (pa.sku)::text))
  • Filter: (parent_asin IS NOT NULL)
  • Rows Removed by Filter: 0
13. 27.345 27.345 ↑ 1.0 1 9,115

Index Scan using ad_groups_pkey on ad_groups ag (cost=0.09..0.10 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=9,115)

  • Index Cond: (id = pa.ad_group_id)
  • Filter: (((state)::text = 'enabled'::text) AND (pa.profile_id = profile_id))
  • Rows Removed by Filter: 0
Planning time : 10.059 ms
Execution time : 208.182 ms