explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sg7F : Optimization for: Optimization for: plan #CAuC; plan #G8nU

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 21.948 768.191 ↓ 389.5 3,895 1

Unique (cost=3,767.07..3,767.08 rows=10 width=19) (actual time=731.695..768.191 rows=3,895 loops=1)

2. 463.215 746.243 ↓ 23,165.4 231,654 1

Sort (cost=3,767.07..3,767.07 rows=10 width=19) (actual time=731.690..746.243 rows=231,654 loops=1)

  • Sort Key: dm.sku, dm.date DESC
  • Sort Method: quicksort Memory: 18534kB
3. 83.145 283.028 ↓ 23,165.4 231,654 1

Hash Join (cost=434.00..3,767.03 rows=10 width=19) (actual time=7.905..283.028 rows=231,654 loops=1)

  • Hash Cond: ((dm.sku)::text = (p.sku)::text)
4. 192.417 192.417 ↓ 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.079..192.417 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
5. 2.661 7.466 ↑ 1.2 5,198 1

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

  • Buckets: 8192 Batches: 1 Memory Usage: 430kB
6. 4.805 4.805 ↑ 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=44) (actual time=0.043..4.805 rows=5,198 loops=1)

  • Index Cond: ((seller_id = 'A1LMQBEOGTEVAC'::text) AND (marketplace_id = 'ATVPDKIKX0DER'::text))
  • Heap Fetches: 389
Planning time : 4.489 ms
Execution time : 768.584 ms