explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lhj

Settings
# exclusive inclusive rows x rows loops node
1. 98.193 46,056.449 ↓ 1.3 12,942 1

Sort (cost=74,854.66..74,879.99 rows=10,134 width=364) (actual time=46,055.178..46,056.449 rows=12,942 loops=1)

  • Output: ((aggr.display_asin)::character varying(10)), ((aggr.asin)::character varying(10)), (round(COALESCE(aggr.dsc, '0'::numeric), 0)), (CASE WHEN (totals.total_sessions = '0'::numeric) THEN '0'::numeric ELSE round(('100'::numeric * (COALESCE(aggr.dsc, '0'::numeric) / totals.total_sessions)), 2) END), (round(COALESCE(aggr.pv, '0'::numeric), 0)), (CASE WHEN (totals.total_pv = '0'::numeric) THEN '0'::numeric ELSE round(('100'::numeric * (COALESCE(aggr.pv, '0'::numeric) / totals.total_pv)), 2) END), (round(COALESCE(aggr.bb, '0'::numeric), 2)), (round(COALESCE(aggr.sum_units, '0'::numeric), 0)), (round(aggr.unit_session_pct, 2)), (COALESCE(aggr.sum_ops, '0'::numeric)), (round(COALESCE(aggr.sum_order_items, '0'::numeric), 0))
  • Sort Key: (round(COALESCE(aggr.sum_order_items, '0'::numeric), 0)), ((aggr.asin)::character varying(10))
  • Sort Method: quicksort Memory: 2204kB
  • Buffers: shared hit=2342 read=28871
2.          

CTE aggr

3. 7.211 45,914.728 ↓ 1.3 12,942 1

Hash Full Join (cost=71,849.53..73,166.96 rows=10,134 width=300) (actual time=45,890.802..45,914.728 rows=12,942 loops=1)

  • Output: COALESCE(d_daily_merchant_asin_activity.display_asin, (sales.display_asin)::bpchar), COALESCE(d_daily_merchant_asin_activity.asin, sales.asin), (sum(d_daily_merchant_asin_activity.page_views)), (sum(d_daily_merchant_asin_activity.distinct_session_count)), (CASE WHEN (sum(d_daily_merchant_asin_activity.page_views) = '0'::numeric) THEN '0'::numeric ELSE ('100'::numeric * (sum(d_daily_merchant_asin_activity.buy_box_page_view_count) / sum(d_daily_merchant_asin_activity.page_views))) END), sales.sum_ops, sales.sum_units, sales.sum_order_items, CASE WHEN (COALESCE((sum(d_daily_merchant_asin_activity.distinct_session_count)), '0'::numeric) = '0'::numeric) THEN '0'::numeric ELSE ('100'::numeric * (COALESCE(sales.sum_units, '0'::numeric) / (sum(d_daily_merchant_asin_activity.distinct_session_count)))) END
  • Hash Cond: ((d_daily_merchant_asin_activity.merchant_customer_id = sales.merchant) AND (d_daily_merchant_asin_activity.display_asin = (sales.display_asin)::bpchar) AND (d_daily_merchant_asin_activity.asin = sales.asin))
  • Buffers: shared hit=2342 read=28871
4. 173.541 45,829.388 ↓ 1.3 12,833 1

HashAggregate (cost=70,945.68..71,249.70 rows=10,134 width=126) (actual time=45,812.654..45,829.388 rows=12,833 loops=1)

  • Output: d_daily_merchant_asin_activity.merchant_customer_id, d_daily_merchant_asin_activity.display_asin, d_daily_merchant_asin_activity.asin, sum(d_daily_merchant_asin_activity.page_views), sum(d_daily_merchant_asin_activity.distinct_session_count), CASE WHEN (sum(d_daily_merchant_asin_activity.page_views) = '0'::numeric) THEN '0'::numeric ELSE ('100'::numeric * (sum(d_daily_merchant_asin_activity.buy_box_page_view_count) / sum(d_daily_merchant_asin_activity.page_views))) END
  • Group Key: d_daily_merchant_asin_activity.merchant_customer_id, d_daily_merchant_asin_activity.display_asin, d_daily_merchant_asin_activity.asin
  • Buffers: shared hit=1184 read=28850
5. 14.680 45,655.847 ↑ 3.4 29,407 1

Append (cost=0.00..68,918.80 rows=101,344 width=43) (actual time=150.547..45,655.847 rows=29,407 loops=1)

  • Buffers: shared hit=1184 read=28850
6. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on booker.d_daily_merchant_asin_activity (cost=0.00..0.00 rows=1 width=144) (actual time=0.002..0.002 rows=0 loops=1)

  • Output: d_daily_merchant_asin_activity.merchant_customer_id, d_daily_merchant_asin_activity.display_asin, d_daily_merchant_asin_activity.asin, d_daily_merchant_asin_activity.page_views, d_daily_merchant_asin_activity.distinct_session_count, d_daily_merchant_asin_activity.buy_box_page_view_count
  • Filter: ((d_daily_merchant_asin_activity.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (d_daily_merchant_asin_activity.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone) AND (d_daily_merchant_asin_activity.merchant_customer_id = '7113910715'::bigint) AND (d_daily_merchant_asin_activity.marketplace_id = 1))
7. 4.109 4.109 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_0 on booker.ddmaa_201903_0 (cost=0.70..2.72 rows=1 width=43) (actual time=4.109..4.109 rows=0 loops=1)

  • Output: ddmaa_201903_0.merchant_customer_id, ddmaa_201903_0.display_asin, ddmaa_201903_0.asin, ddmaa_201903_0.page_views, ddmaa_201903_0.distinct_session_count, ddmaa_201903_0.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_0.marketplace_id = 1) AND (ddmaa_201903_0.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_0.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_0.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
8. 4.253 4.253 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_1 on booker.ddmaa_201903_1 (cost=0.70..2.72 rows=1 width=43) (actual time=4.253..4.253 rows=0 loops=1)

  • Output: ddmaa_201903_1.merchant_customer_id, ddmaa_201903_1.display_asin, ddmaa_201903_1.asin, ddmaa_201903_1.page_views, ddmaa_201903_1.distinct_session_count, ddmaa_201903_1.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_1.marketplace_id = 1) AND (ddmaa_201903_1.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_1.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_1.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
9. 4.637 4.637 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_2 on booker.ddmaa_201903_2 (cost=0.70..2.72 rows=1 width=43) (actual time=4.637..4.637 rows=0 loops=1)

  • Output: ddmaa_201903_2.merchant_customer_id, ddmaa_201903_2.display_asin, ddmaa_201903_2.asin, ddmaa_201903_2.page_views, ddmaa_201903_2.distinct_session_count, ddmaa_201903_2.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_2.marketplace_id = 1) AND (ddmaa_201903_2.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_2.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_2.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
10. 23.106 23.106 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_3 on booker.ddmaa_201903_3 (cost=0.70..2.72 rows=1 width=43) (actual time=23.106..23.106 rows=0 loops=1)

  • Output: ddmaa_201903_3.merchant_customer_id, ddmaa_201903_3.display_asin, ddmaa_201903_3.asin, ddmaa_201903_3.page_views, ddmaa_201903_3.distinct_session_count, ddmaa_201903_3.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_3.marketplace_id = 1) AND (ddmaa_201903_3.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_3.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_3.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
11. 4.809 4.809 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_4 on booker.ddmaa_201903_4 (cost=0.70..2.72 rows=1 width=43) (actual time=4.809..4.809 rows=0 loops=1)

  • Output: ddmaa_201903_4.merchant_customer_id, ddmaa_201903_4.display_asin, ddmaa_201903_4.asin, ddmaa_201903_4.page_views, ddmaa_201903_4.distinct_session_count, ddmaa_201903_4.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_4.marketplace_id = 1) AND (ddmaa_201903_4.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_4.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_4.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
12. 4.533 4.533 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_5 on booker.ddmaa_201903_5 (cost=0.70..2.72 rows=1 width=43) (actual time=4.533..4.533 rows=0 loops=1)

  • Output: ddmaa_201903_5.merchant_customer_id, ddmaa_201903_5.display_asin, ddmaa_201903_5.asin, ddmaa_201903_5.page_views, ddmaa_201903_5.distinct_session_count, ddmaa_201903_5.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_5.marketplace_id = 1) AND (ddmaa_201903_5.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_5.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_5.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
13. 18.090 18.090 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_6 on booker.ddmaa_201903_6 (cost=0.70..2.72 rows=1 width=43) (actual time=18.090..18.090 rows=0 loops=1)

  • Output: ddmaa_201903_6.merchant_customer_id, ddmaa_201903_6.display_asin, ddmaa_201903_6.asin, ddmaa_201903_6.page_views, ddmaa_201903_6.distinct_session_count, ddmaa_201903_6.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_6.marketplace_id = 1) AND (ddmaa_201903_6.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_6.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_6.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
14. 5.402 5.402 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_7 on booker.ddmaa_201903_7 (cost=0.70..2.72 rows=1 width=43) (actual time=5.402..5.402 rows=0 loops=1)

  • Output: ddmaa_201903_7.merchant_customer_id, ddmaa_201903_7.display_asin, ddmaa_201903_7.asin, ddmaa_201903_7.page_views, ddmaa_201903_7.distinct_session_count, ddmaa_201903_7.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_7.marketplace_id = 1) AND (ddmaa_201903_7.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_7.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_7.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
15. 5.087 5.087 ↓ 0.0 0 1

Index Scan using i_ddmaa_201903_8 on booker.ddmaa_201903_8 (cost=0.70..2.72 rows=1 width=43) (actual time=5.087..5.087 rows=0 loops=1)

  • Output: ddmaa_201903_8.merchant_customer_id, ddmaa_201903_8.display_asin, ddmaa_201903_8.asin, ddmaa_201903_8.page_views, ddmaa_201903_8.distinct_session_count, ddmaa_201903_8.buy_box_page_view_count
  • Index Cond: ((ddmaa_201903_8.marketplace_id = 1) AND (ddmaa_201903_8.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201903_8.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201903_8.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
16. 3.361 3.361 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_0 on booker.ddmaa_201904_0 (cost=0.70..7,125.98 rows=10,217 width=43) (actual time=3.361..3.361 rows=0 loops=1)

  • Output: ddmaa_201904_0.merchant_customer_id, ddmaa_201904_0.display_asin, ddmaa_201904_0.asin, ddmaa_201904_0.page_views, ddmaa_201904_0.distinct_session_count, ddmaa_201904_0.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_0.marketplace_id = 1) AND (ddmaa_201904_0.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_0.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_0.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=2 read=3
17. 5.986 5.986 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_1 on booker.ddmaa_201904_1 (cost=0.70..6,734.28 rows=9,177 width=43) (actual time=5.986..5.986 rows=0 loops=1)

  • Output: ddmaa_201904_1.merchant_customer_id, ddmaa_201904_1.display_asin, ddmaa_201904_1.asin, ddmaa_201904_1.page_views, ddmaa_201904_1.distinct_session_count, ddmaa_201904_1.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_1.marketplace_id = 1) AND (ddmaa_201904_1.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_1.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_1.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
18. 5.635 5.635 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_2 on booker.ddmaa_201904_2 (cost=0.70..9,067.34 rows=14,137 width=43) (actual time=5.635..5.635 rows=0 loops=1)

  • Output: ddmaa_201904_2.merchant_customer_id, ddmaa_201904_2.display_asin, ddmaa_201904_2.asin, ddmaa_201904_2.page_views, ddmaa_201904_2.distinct_session_count, ddmaa_201904_2.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_2.marketplace_id = 1) AND (ddmaa_201904_2.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_2.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_2.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
19. 5.314 5.314 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_3 on booker.ddmaa_201904_3 (cost=0.70..8,177.61 rows=11,085 width=43) (actual time=5.314..5.314 rows=0 loops=1)

  • Output: ddmaa_201904_3.merchant_customer_id, ddmaa_201904_3.display_asin, ddmaa_201904_3.asin, ddmaa_201904_3.page_views, ddmaa_201904_3.distinct_session_count, ddmaa_201904_3.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_3.marketplace_id = 1) AND (ddmaa_201904_3.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_3.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_3.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
20. 32.861 32.861 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_4 on booker.ddmaa_201904_4 (cost=0.70..7,158.49 rows=11,193 width=43) (actual time=32.861..32.861 rows=0 loops=1)

  • Output: ddmaa_201904_4.merchant_customer_id, ddmaa_201904_4.display_asin, ddmaa_201904_4.asin, ddmaa_201904_4.page_views, ddmaa_201904_4.distinct_session_count, ddmaa_201904_4.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_4.marketplace_id = 1) AND (ddmaa_201904_4.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_4.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_4.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
21. 6.332 6.332 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_5 on booker.ddmaa_201904_5 (cost=0.70..7,604.67 rows=11,482 width=43) (actual time=6.332..6.332 rows=0 loops=1)

  • Output: ddmaa_201904_5.merchant_customer_id, ddmaa_201904_5.display_asin, ddmaa_201904_5.asin, ddmaa_201904_5.page_views, ddmaa_201904_5.distinct_session_count, ddmaa_201904_5.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_5.marketplace_id = 1) AND (ddmaa_201904_5.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_5.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_5.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=5
22. 5.506 5.506 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_6 on booker.ddmaa_201904_6 (cost=0.70..7,931.90 rows=11,313 width=43) (actual time=5.506..5.506 rows=0 loops=1)

  • Output: ddmaa_201904_6.merchant_customer_id, ddmaa_201904_6.display_asin, ddmaa_201904_6.asin, ddmaa_201904_6.page_views, ddmaa_201904_6.distinct_session_count, ddmaa_201904_6.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_6.marketplace_id = 1) AND (ddmaa_201904_6.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_6.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_6.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
23. 5.131 5.131 ↓ 0.0 0 1

Index Scan using i_ddmaa_201904_7 on booker.ddmaa_201904_7 (cost=0.70..6,782.50 rows=10,028 width=43) (actual time=5.131..5.131 rows=0 loops=1)

  • Output: ddmaa_201904_7.merchant_customer_id, ddmaa_201904_7.display_asin, ddmaa_201904_7.asin, ddmaa_201904_7.page_views, ddmaa_201904_7.distinct_session_count, ddmaa_201904_7.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_7.marketplace_id = 1) AND (ddmaa_201904_7.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_7.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_7.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=4
24. 45,497.013 45,497.013 ↓ 2.3 29,407 1

Index Scan using i_ddmaa_201904_8 on booker.ddmaa_201904_8 (cost=0.70..8,311.53 rows=12,702 width=43) (actual time=6.378..45,497.013 rows=29,407 loops=1)

  • Output: ddmaa_201904_8.merchant_customer_id, ddmaa_201904_8.display_asin, ddmaa_201904_8.asin, ddmaa_201904_8.page_views, ddmaa_201904_8.distinct_session_count, ddmaa_201904_8.buy_box_page_view_count
  • Index Cond: ((ddmaa_201904_8.marketplace_id = 1) AND (ddmaa_201904_8.merchant_customer_id = '7113910715'::bigint) AND (ddmaa_201904_8.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (ddmaa_201904_8.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1166 read=28782
25. 0.306 78.129 ↓ 4.7 941 1

Hash (cost=900.35..900.35 rows=200 width=126) (actual time=78.129..78.129 rows=941 loops=1)

  • Output: sales.display_asin, sales.asin, sales.sum_ops, sales.sum_units, sales.sum_order_items, sales.merchant
  • Buckets: 1024 Batches: 1 Memory Usage: 82kB
  • Buffers: shared hit=1158 read=21
26. 0.103 77.823 ↓ 4.7 941 1

Subquery Scan on sales (cost=894.85..900.35 rows=200 width=126) (actual time=77.198..77.823 rows=941 loops=1)

  • Output: sales.display_asin, sales.asin, sales.sum_ops, sales.sum_units, sales.sum_order_items, sales.merchant
  • Buffers: shared hit=1158 read=21
27. 1.996 77.720 ↓ 4.7 941 1

HashAggregate (cost=894.85..898.35 rows=200 width=126) (actual time=77.198..77.720 rows=941 loops=1)

  • Output: daily_merchant_asin_sales.merchant, daily_merchant_asin_sales.display_asin, daily_merchant_asin_sales.asin, sum(daily_merchant_asin_sales.ops), sum(daily_merchant_asin_sales.units), sum(daily_merchant_asin_sales.order_items)
  • Group Key: daily_merchant_asin_sales.merchant, daily_merchant_asin_sales.display_asin, daily_merchant_asin_sales.asin
  • Buffers: shared hit=1158 read=21
28. 0.098 75.724 ↑ 1.1 1,145 1

Append (cost=0.00..875.60 rows=1,283 width=44) (actual time=6.508..75.724 rows=1,145 loops=1)

  • Buffers: shared hit=1158 read=21
29. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on booker.daily_merchant_asin_sales (cost=0.00..0.00 rows=1 width=142) (actual time=0.002..0.002 rows=0 loops=1)

  • Output: daily_merchant_asin_sales.merchant, daily_merchant_asin_sales.display_asin, daily_merchant_asin_sales.asin, daily_merchant_asin_sales.ops, daily_merchant_asin_sales.units, daily_merchant_asin_sales.order_items
  • Filter: ((daily_merchant_asin_sales.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (daily_merchant_asin_sales.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone) AND (daily_merchant_asin_sales.marketplace_id = 1) AND (daily_merchant_asin_sales.merchant = '7113910715'::bigint))
30. 3.394 3.394 ↓ 0.0 0 1

Index Scan using i_dmas_201903_2 on booker.dmas_201903 (cost=0.57..2.59 rows=1 width=44) (actual time=3.394..3.394 rows=0 loops=1)

  • Output: dmas_201903.merchant, dmas_201903.display_asin, dmas_201903.asin, dmas_201903.ops, dmas_201903.units, dmas_201903.order_items
  • Index Cond: ((dmas_201903.marketplace_id = 1) AND (dmas_201903.merchant = '7113910715'::bigint) AND (dmas_201903.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (dmas_201903.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1 read=3
31. 72.230 72.230 ↑ 1.1 1,145 1

Index Scan using i_dmas_201904_2 on booker.dmas_201904 (cost=0.57..873.01 rows=1,281 width=44) (actual time=3.110..72.230 rows=1,145 loops=1)

  • Output: dmas_201904.merchant, dmas_201904.display_asin, dmas_201904.asin, dmas_201904.ops, dmas_201904.units, dmas_201904.order_items
  • Index Cond: ((dmas_201904.marketplace_id = 1) AND (dmas_201904.merchant = '7113910715'::bigint) AND (dmas_201904.metrics_date >= '2019-03-31 12:00:00'::timestamp without time zone) AND (dmas_201904.metrics_date <= '2019-04-15 12:00:00'::timestamp without time zone))
  • Buffers: shared hit=1157 read=18
32.          

CTE totals

33. 4.357 45,925.256 ↑ 1.0 1 1

Aggregate (cost=253.36..253.37 rows=1 width=64) (actual time=45,925.256..45,925.256 rows=1 loops=1)

  • Output: sum(COALESCE(aggr_1.pv, '0'::numeric)), sum(COALESCE(aggr_1.dsc, '0'::numeric))
  • Buffers: shared hit=2342 read=28871
34. 45,920.899 45,920.899 ↓ 1.3 12,942 1

CTE Scan on aggr aggr_1 (cost=0.00..202.68 rows=10,134 width=64) (actual time=45,890.805..45,920.899 rows=12,942 loops=1)

  • Output: aggr_1.display_asin, aggr_1.asin, aggr_1.pv, aggr_1.dsc, aggr_1.bb, aggr_1.sum_ops, aggr_1.sum_units, aggr_1.sum_order_items, aggr_1.unit_session_pct
  • Buffers: shared hit=2342 read=28871
35. 31.677 45,958.256 ↓ 1.3 12,942 1

Nested Loop (cost=0.00..760.07 rows=10,134 width=364) (actual time=45,925.291..45,958.256 rows=12,942 loops=1)

  • Output: (aggr.display_asin)::character varying(10), (aggr.asin)::character varying(10), round(COALESCE(aggr.dsc, '0'::numeric), 0), CASE WHEN (totals.total_sessions = '0'::numeric) THEN '0'::numeric ELSE round(('100'::numeric * (COALESCE(aggr.dsc, '0'::numeric) / totals.total_sessions)), 2) END, round(COALESCE(aggr.pv, '0'::numeric), 0), CASE WHEN (totals.total_pv = '0'::numeric) THEN '0'::numeric ELSE round(('100'::numeric * (COALESCE(aggr.pv, '0'::numeric) / totals.total_pv)), 2) END, round(COALESCE(aggr.bb, '0'::numeric), 2), round(COALESCE(aggr.sum_units, '0'::numeric), 0), round(aggr.unit_session_pct, 2), COALESCE(aggr.sum_ops, '0'::numeric), round(COALESCE(aggr.sum_order_items, '0'::numeric), 0)
  • Buffers: shared hit=2342 read=28871
36. 45,925.257 45,925.257 ↑ 1.0 1 1

CTE Scan on totals (cost=0.00..0.02 rows=1 width=64) (actual time=45,925.257..45,925.257 rows=1 loops=1)

  • Output: totals.total_pv, totals.total_sessions
  • Buffers: shared hit=2342 read=28871
37. 1.322 1.322 ↓ 1.3 12,942 1

CTE Scan on aggr (cost=0.00..202.68 rows=10,134 width=300) (actual time=0.001..1.322 rows=12,942 loops=1)

  • Output: aggr.display_asin, aggr.asin, aggr.pv, aggr.dsc, aggr.bb, aggr.sum_ops, aggr.sum_units, aggr.sum_order_items, aggr.unit_session_pct