explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G8nU : Optimization for: plan #CAuC

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 19.862 1,436.055 ↓ 3,823.0 3,823 1

Unique (cost=3,791.51..3,791.51 rows=1 width=19) (actual time=1,404.208..1,436.055 rows=3,823 loops=1)

2. 458.180 1,416.193 ↓ 227,262.0 227,262 1

Sort (cost=3,791.51..3,791.51 rows=1 width=19) (actual time=1,404.206..1,416.193 rows=227,262 loops=1)

  • Sort Key: dm.sku, dm.date DESC
  • Sort Method: quicksort Memory: 18266kB
3. 174.352 958.013 ↓ 227,262.0 227,262 1

Nested Loop (cost=434.08..3,791.50 rows=1 width=19) (actual time=8.812..958.013 rows=227,262 loops=1)

4. 85.035 320.353 ↓ 23,165.4 231,654 1

Hash Join (cost=434.00..3,767.03 rows=10 width=35) (actual time=8.774..320.353 rows=231,654 loops=1)

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

Index Only Scan using daily_product_metrics_ongoing_totals_pkey on daily_product_metrics_ongoing_totals dm (cost=0.14..3,286.26 rows=89,354 width=47) (actual time=0.144..227.158 rows=294,606 loops=1)

  • Index Cond: ((seller_id = 'A1LMQBEOGTEVAC'::text) AND (marketplace_id = '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 Fetches: 94409
6. 3.037 8.160 ↑ 1.2 5,198 1

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

  • Buckets: 8192 Batches: 1 Memory Usage: 511kB
7. 5.123 5.123 ↑ 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.050..5.123 rows=5,198 loops=1)

  • Index Cond: ((seller_id = 'A1LMQBEOGTEVAC'::text) AND (marketplace_id = 'ATVPDKIKX0DER'::text))
  • Heap Fetches: 389
8. 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.480 ms
Execution time : 1,436.441 ms