explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WBgZ

Settings
# exclusive inclusive rows x rows loops node
1. 163.550 6,454.830 ↑ 1.0 1 1

GroupAggregate (cost=340,834.22..491,782.46 rows=1 width=12) (actual time=6,454.830..6,454.830 rows=1 loops=1)

  • Group Key: retailer.marketplace_id
2. 297.401 6,291.280 ↓ 1.3 668,010 1

Nested Loop Left Join (cost=340,834.22..489,179.93 rows=520,505 width=16) (actual time=3,538.088..6,291.280 rows=668,010 loops=1)

  • Join Filter: (marketplace_upc.marketplace_id = retailer.marketplace_id)
3. 0.072 0.072 ↑ 1.0 1 1

Seq Scan on retailer (cost=0.00..6.74 rows=1 width=4) (actual time=0.017..0.072 rows=1 loops=1)

  • Filter: (marketplace_id = 35)
  • Rows Removed by Filter: 299
4. 1,518.734 5,993.807 ↓ 1.3 668,010 1

Merge Right Join (cost=340,834.22..482,666.88 rows=520,505 width=16) (actual time=3,538.057..5,993.807 rows=668,010 loops=1)

  • Merge Cond: ((product_ids.gtin_14)::text = (marketplace_upc.gtin_14)::text)
5. 743.369 743.369 ↑ 1.2 2,393,052 1

Index Only Scan using product_ids_gtin_14_index on product_ids (cost=0.43..149,530.89 rows=2,821,231 width=15) (actual time=0.016..743.369 rows=2,393,052 loops=1)

  • Heap Fetches: 59,786
6. 3,492.791 3,731.704 ↓ 1.4 668,010 1

Sort (cost=340,833.79..342,040.67 rows=482,752 width=29) (actual time=3,538.035..3,731.704 rows=668,010 loops=1)

  • Sort Key: marketplace_upc.gtin_14
  • Sort Method: quicksort Memory: 52,255kB
7. 204.229 238.913 ↓ 1.1 511,575 1

Bitmap Heap Scan on marketplace_upc (cost=11,329.76..295,259.77 rows=482,752 width=29) (actual time=38.839..238.913 rows=511,575 loops=1)

  • Recheck Cond: (marketplace_id = 35)
  • Heap Blocks: exact=24,318
8. 34.684 34.684 ↓ 1.1 511,575 1

Bitmap Index Scan on marketplace_upc_marketplace_id_index (cost=0.00..11,209.07 rows=482,752 width=0) (actual time=34.684..34.684 rows=511,575 loops=1)

  • Index Cond: (marketplace_id = 35)
Planning time : 1.721 ms
Execution time : 6,457.940 ms