explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CAuC

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 24.545 1,475.949 ↓ 3,823.0 3,823 1

Unique (cost=175,953.53..175,953.53 rows=1 width=103) (actual time=1,434.387..1,475.949 rows=3,823 loops=1)

2. 515.518 1,451.404 ↓ 227,262.0 227,262 1

Sort (cost=175,953.53..175,953.53 rows=1 width=103) (actual time=1,434.386..1,451.404 rows=227,262 loops=1)

  • Sort Key: dm.sku, dm.date DESC
  • Sort Method: quicksort Memory: 47394kB
3. 35.259 935.886 ↓ 227,262.0 227,262 1

Nested Loop (cost=2,758.61..175,953.53 rows=1 width=103) (actual time=118.298..935.886 rows=227,262 loops=1)

4. 84.661 437.319 ↓ 23,165.4 231,654 1

Hash Join (cost=2,758.53..175,929.05 rows=10 width=119) (actual time=118.190..437.319 rows=231,654 loops=1)

  • Hash Cond: ((dm.sku)::text = (p.sku)::text)
5. 249.689 345.962 ↓ 3.3 294,606 1

Bitmap Heap Scan on daily_product_metrics_ongoing_totals dm (cost=2,324.67..175,448.29 rows=89,354 width=103) (actual time=111.434..345.962 rows=294,606 loops=1)

  • Recheck Cond: (((seller_id)::text = 'A1LMQBEOGTEVAC'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text) AND (date >= '2019-04-09 00:00:00'::timestamp without time zone) AND (date <= '2019-06-08 00:00:00'::timestamp without time zone))
  • Heap Blocks: exact=78786
6. 96.273 96.273 ↓ 3.3 294,606 1

Bitmap Index Scan on dpm_ongoing_totals__sellerid__marketplaceid__date__parent_asin (cost=0.00..2,320.20 rows=89,354 width=0) (actual time=96.273..96.273 rows=294,606 loops=1)

  • Index Cond: (((seller_id)::text = 'A1LMQBEOGTEVAC'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text) AND (date >= '2019-04-09 00:00:00'::timestamp without time zone) AND (date <= '2019-06-08 00:00:00'::timestamp without time zone))
7. 2.441 6.696 ↑ 1.2 5,198 1

Hash (cost=411.59..411.59 rows=6,362 width=60) (actual time=6.696..6.696 rows=5,198 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 511kB
8. 4.255 4.255 ↑ 1.2 5,198 1

Index Only Scan using products_seller_marketplace_sku_unique on products p (cost=0.11..411.59 rows=6,362 width=60) (actual time=0.057..4.255 rows=5,198 loops=1)

  • Index Cond: ((seller_id = 'A1LMQBEOGTEVAC'::text) AND (marketplace_id = 'ATVPDKIKX0DER'::text))
  • Heap Fetches: 389
9. 463.308 463.308 ↑ 1.0 1 231,654

Index Only Scan using product_firsts_pkey on product_firsts pfs (cost=0.09..2.45 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=231,654)

  • Index Cond: (tm_product_id = p.tm_id)
  • Heap Fetches: 167012
Planning time : 5.103 ms
Execution time : 1,478.762 ms