explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ydo6

Settings
# exclusive inclusive rows x rows loops node
1. 40.885 3,963.595 ↑ 32.1 3,706 1

Unique (cost=601,460.05..601,578.85 rows=118,800 width=32) (actual time=3,892.887..3,963.595 rows=3,706 loops=1)

2. 577.457 3,922.710 ↓ 4.0 471,192 1

Sort (cost=601,460.05..601,519.45 rows=118,800 width=32) (actual time=3,892.885..3,922.710 rows=471,192 loops=1)

  • Sort Key: (COALESCE(daily_product_costs.sku, daily_product_metrics.sku))
  • Sort Method: quicksort Memory: 34376kB
3. 227.490 3,345.253 ↓ 4.0 471,192 1

Hash Full Join (cost=161,560.49..599,457.30 rows=118,800 width=32) (actual time=705.256..3,345.253 rows=471,192 loops=1)

  • Hash Cond: (((daily_product_metrics.seller_id)::text = (daily_product_costs.seller_id)::text) AND ((daily_product_metrics.marketplace_id)::text = (daily_product_costs.marketplace_id)::text) AND (daily_product_metrics.date = daily_product_costs.date) AND ((daily_product_metrics.sku)::text = (daily_product_costs.sku)::text))
4. 2,453.921 2,638.573 ↓ 16.9 444,263 1

Bitmap Heap Scan on daily_product_metrics (cost=7,893.79..445,735.41 rows=26,283 width=47) (actual time=225.843..2,638.573 rows=444,263 loops=1)

  • Recheck Cond: (((seller_id)::text = 'A1LMQBEOGTEVAC'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: ((ad_revenue <> '0'::numeric) OR (ad_spend <> '0'::numeric) OR (clicks <> 0) OR (conversions <> 0) OR (impressions <> 0))
  • Rows Removed by Filter: 862473
  • Heap Blocks: exact=201056
5. 184.652 184.652 ↓ 6.2 1,430,131 1

Bitmap Index Scan on daily_product_metrics_pkey (cost=0.00..7,892.48 rows=232,169 width=0) (actual time=184.652..184.652 rows=1,430,131 loops=1)

  • Index Cond: (((seller_id)::text = 'A1LMQBEOGTEVAC'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
6. 48.627 479.190 ↓ 1.0 123,558 1

Hash (cost=153,072.70..153,072.70 rows=118,800 width=46) (actual time=479.190..479.190 rows=123,558 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 10303kB
7. 379.622 430.563 ↓ 1.0 123,558 1

Bitmap Heap Scan on daily_product_costs (cost=3,851.65..153,072.70 rows=118,800 width=46) (actual time=60.968..430.563 rows=123,558 loops=1)

  • Recheck Cond: (((seller_id)::text = 'A1LMQBEOGTEVAC'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: ((total_revenue <> '0'::numeric) OR (quantity_sold <> 0))
  • Heap Blocks: exact=35216
8. 50.941 50.941 ↓ 1.0 123,580 1

Bitmap Index Scan on daily_product_costs_pkey (cost=0.00..3,845.71 rows=118,800 width=0) (actual time=50.941..50.941 rows=123,580 loops=1)

  • Index Cond: (((seller_id)::text = 'A1LMQBEOGTEVAC'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
Planning time : 3.208 ms
Execution time : 3,967.716 ms