explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aRV7 : Optimization for: idx02_sal_f_sales_det_cab_201712; plan #ZmPE

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3,976.395 9,196.252 ↓ 7,842,839.0 7,842,839 1

Gather (cost=1,000.00..482,506.48 rows=1 width=128) (actual time=2.202..9,196.252 rows=7,842,839 loops=1)

  • Output: sal_f_sales_det_cab.id_store, sal_f_sales_det_cab.id_tpv, sal_f_sales_det_cab.id_ticket, sal_f_sales_det_cab.id_cash, sal_f_sales_det_cab.dt_sale, sal_f_sales_det_cab.ti_hour, sal_f_sales_det_cab.id_ticket_type, sal_f_sales_det_cab.vl_sale, sal_f_sales_det_cab.co_service, sal_f_sales_det_cab.co_card, sal_f_sales_det_lin.id_store, sal_f_sales_det_lin.id_tpv, sal_f_sales_det_lin.id_ticket, sal_f_sales_det_lin.id_cash, sal_f_sales_det_lin.dt_sale, sal_f_sales_det_lin.ti_hour, sal_f_sales_det_lin.id_ticket_type, sal_f_sales_det_lin.id_line_type, sal_f_sales_det_lin.co_department, sal_f_sales_det_lin.vl_sale_ori, sal_f_sales_det_lin.vl_sale, sal_f_sales_det_lin.qt_units, sal_f_sales_det_lin.co_section, sal_f_sales_det_lin.id_tax, sal_f_sales_det_lin.co_product, sal_f_sales_det_lin.id_offer, sal_f_sales_det_lin.vl_amount, sal_f_sales_det_lin.id_format, sal_f_sales_det_lin.co_auxiliar
  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=7173076
2. 1,149.753 5,219.857 ↓ 1,960,710.0 1,960,710 4 / 4

Nested Loop (cost=0.00..481,506.38 rows=1 width=128) (actual time=0.120..5,219.857 rows=1,960,710 loops=4)

  • Output: sal_f_sales_det_cab.id_store, sal_f_sales_det_cab.id_tpv, sal_f_sales_det_cab.id_ticket, sal_f_sales_det_cab.id_cash, sal_f_sales_det_cab.dt_sale, sal_f_sales_det_cab.ti_hour, sal_f_sales_det_cab.id_ticket_type, sal_f_sales_det_cab.vl_sale, sal_f_sales_det_cab.co_service, sal_f_sales_det_cab.co_card, sal_f_sales_det_lin.id_store, sal_f_sales_det_lin.id_tpv, sal_f_sales_det_lin.id_ticket, sal_f_sales_det_lin.id_cash, sal_f_sales_det_lin.dt_sale, sal_f_sales_det_lin.ti_hour, sal_f_sales_det_lin.id_ticket_type, sal_f_sales_det_lin.id_line_type, sal_f_sales_det_lin.co_department, sal_f_sales_det_lin.vl_sale_ori, sal_f_sales_det_lin.vl_sale, sal_f_sales_det_lin.qt_units, sal_f_sales_det_lin.co_section, sal_f_sales_det_lin.id_tax, sal_f_sales_det_lin.co_product, sal_f_sales_det_lin.id_offer, sal_f_sales_det_lin.vl_amount, sal_f_sales_det_lin.id_format, sal_f_sales_det_lin.co_auxiliar
  • Buffers: shared hit=7172413
  • Worker 0: actual time=0.140..6165.542 rows=2515290 loops=1
  • Buffers: shared hit=2295961
  • Worker 1: actual time=0.127..6180.383 rows=2564147 loops=1
  • Buffers: shared hit=2344245
  • Worker 2: actual time=0.136..6155.071 rows=2548494 loops=1
  • Buffers: shared hit=2323171
3. 47.922 234.410 ↑ 1.3 348,700 4 / 4

Append (cost=0.00..21,372.58 rows=449,876 width=45) (actual time=0.024..234.410 rows=348,700 loops=4)

  • Buffers: shared hit=14450
  • Worker 0: actual time=0.029..297.762 rows=446298 loops=1
  • Buffers: shared hit=4604
  • Worker 1: actual time=0.022..293.911 rows=455838 loops=1
  • Buffers: shared hit=4696
  • Worker 2: actual time=0.028..295.267 rows=451854 loops=1
  • Buffers: shared hit=4646
4. 0.001 0.001 ↓ 0.0 0 4 / 4

Parallel Seq Scan on public.sal_f_sales_det_cab (cost=0.00..0.00 rows=1 width=92) (actual time=0.001..0.001 rows=0 loops=4)

  • Output: sal_f_sales_det_cab.id_store, sal_f_sales_det_cab.id_tpv, sal_f_sales_det_cab.id_ticket, sal_f_sales_det_cab.id_cash, sal_f_sales_det_cab.dt_sale, sal_f_sales_det_cab.ti_hour, sal_f_sales_det_cab.id_ticket_type, sal_f_sales_det_cab.vl_sale, sal_f_sales_det_cab.co_service, sal_f_sales_det_cab.co_card
  • Filter: ((sal_f_sales_det_cab.dt_sale >= '2017-12-01'::date) AND (sal_f_sales_det_cab.dt_sale <= '2017-12-30'::date))
  • Worker 0: actual time=0.000..0.000 rows=0 loops=1
  • Worker 1: actual time=0.000..0.000 rows=0 loops=1
  • Worker 2: actual time=0.001..0.001 rows=0 loops=1
5. 186.487 186.487 ↑ 1.3 348,700 4 / 4

Parallel Seq Scan on public.sal_f_sales_det_cab_201712 (cost=0.00..21,372.58 rows=449,875 width=45) (actual time=0.022..186.487 rows=348,700 loops=4)

  • Output: sal_f_sales_det_cab_201712.id_store, sal_f_sales_det_cab_201712.id_tpv, sal_f_sales_det_cab_201712.id_ticket, sal_f_sales_det_cab_201712.id_cash, sal_f_sales_det_cab_201712.dt_sale, sal_f_sales_det_cab_201712.ti_hour, sal_f_sales_det_cab_201712.id_ticket_type, sal_f_sales_det_cab_201712.vl_sale, sal_f_sales_det_cab_201712.co_service, sal_f_sales_det_cab_201712.co_card
  • Filter: ((sal_f_sales_det_cab_201712.dt_sale >= '2017-12-01'::date) AND (sal_f_sales_det_cab_201712.dt_sale <= '2017-12-30'::date))
  • Rows Removed by Filter: 8967
  • Buffers: shared hit=14450
  • Worker 0: actual time=0.028..235.689 rows=446298 loops=1
  • Buffers: shared hit=4604
  • Worker 1: actual time=0.022..233.572 rows=455838 loops=1
  • Buffers: shared hit=4696
  • Worker 2: actual time=0.026..232.946 rows=451854 loops=1
  • Buffers: shared hit=4646
6. 1,046.098 3,835.694 ↓ 3.0 6 1,394,798 / 4

Append (cost=0.00..1.00 rows=2 width=83) (actual time=0.008..0.011 rows=6 loops=1,394,798)

  • Buffers: shared hit=7157963
  • Worker 0: actual time=0.007..0.010 rows=6 loops=446298
  • Buffers: shared hit=2291357
  • Worker 1: actual time=0.007..0.010 rows=6 loops=455838
  • Buffers: shared hit=2339549
  • Worker 2: actual time=0.007..0.010 rows=6 loops=451854
  • Buffers: shared hit=2318525
7. 0.000 0.000 ↓ 0.0 0 1,394,798 / 4

Seq Scan on public.sal_f_sales_det_lin (cost=0.00..0.00 rows=1 width=194) (actual time=0.000..0.000 rows=0 loops=1,394,798)

  • Output: sal_f_sales_det_lin.id_store, sal_f_sales_det_lin.id_tpv, sal_f_sales_det_lin.id_ticket, sal_f_sales_det_lin.id_cash, sal_f_sales_det_lin.dt_sale, sal_f_sales_det_lin.ti_hour, sal_f_sales_det_lin.id_ticket_type, sal_f_sales_det_lin.id_line_type, sal_f_sales_det_lin.co_department, sal_f_sales_det_lin.vl_sale_ori, sal_f_sales_det_lin.vl_sale, sal_f_sales_det_lin.qt_units, sal_f_sales_det_lin.co_section, sal_f_sales_det_lin.id_tax, sal_f_sales_det_lin.co_product, sal_f_sales_det_lin.id_offer, sal_f_sales_det_lin.vl_amount, sal_f_sales_det_lin.id_format, sal_f_sales_det_lin.co_auxiliar
  • Filter: ((sal_f_sales_det_lin.dt_sale >= '2017-12-01'::date) AND (sal_f_sales_det_lin.dt_sale <= '2017-12-30'::date) AND (sal_f_sales_det_lin.dt_sale >= '2017-12-01'::date) AND (sal_f_sales_det_lin.dt_sale <= '2017-12-30'::date) AND (sal_f_sales_det_cab.ti_hour = sal_f_sales_det_lin.ti_hour) AND (sal_f_sales_det_cab.id_store = sal_f_sales_det_lin.id_store) AND (sal_f_sales_det_cab.id_cash = sal_f_sales_det_lin.id_cash) AND (sal_f_sales_det_cab.id_tpv = sal_f_sales_det_lin.id_tpv) AND (sal_f_sales_det_cab.id_ticket = sal_f_sales_det_lin.id_ticket) AND (sal_f_sales_det_cab.dt_sale = sal_f_sales_det_lin.dt_sale))
  • Worker 0: actual time=0.000..0.000 rows=0 loops=446298
  • Worker 1: actual time=0.000..0.000 rows=0 loops=455838
  • Worker 2: actual time=0.000..0.000 rows=0 loops=451854
8. 2,789.596 2,789.596 ↓ 6.0 6 1,394,798 / 4

Index Scan using idx04_sal_f_sales_det_lin_201712 on public.sal_f_sales_det_lin_201712 (cost=0.56..1.00 rows=1 width=83) (actual time=0.006..0.008 rows=6 loops=1,394,798)

  • Output: sal_f_sales_det_lin_201712.id_store, sal_f_sales_det_lin_201712.id_tpv, sal_f_sales_det_lin_201712.id_ticket, sal_f_sales_det_lin_201712.id_cash, sal_f_sales_det_lin_201712.dt_sale, sal_f_sales_det_lin_201712.ti_hour, sal_f_sales_det_lin_201712.id_ticket_type, sal_f_sales_det_lin_201712.id_line_type, sal_f_sales_det_lin_201712.co_department, sal_f_sales_det_lin_201712.vl_sale_ori, sal_f_sales_det_lin_201712.vl_sale, sal_f_sales_det_lin_201712.qt_units, sal_f_sales_det_lin_201712.co_section, sal_f_sales_det_lin_201712.id_tax, sal_f_sales_det_lin_201712.co_product, sal_f_sales_det_lin_201712.id_offer, sal_f_sales_det_lin_201712.vl_amount, sal_f_sales_det_lin_201712.id_format, sal_f_sales_det_lin_201712.co_auxiliar
  • Index Cond: ((sal_f_sales_det_lin_201712.dt_sale = sal_f_sales_det_cab.dt_sale) AND (sal_f_sales_det_lin_201712.dt_sale >= '2017-12-01'::date) AND (sal_f_sales_det_lin_201712.dt_sale <= '2017-12-30'::date) AND (sal_f_sales_det_lin_201712.dt_sale >= '2017-12-01'::date) AND (sal_f_sales_det_lin_201712.dt_sale <= '2017-12-30'::date) AND (sal_f_sales_det_lin_201712.ti_hour = sal_f_sales_det_cab.ti_hour) AND (sal_f_sales_det_lin_201712.id_store = sal_f_sales_det_cab.id_store) AND (sal_f_sales_det_lin_201712.id_cash = sal_f_sales_det_cab.id_cash) AND (sal_f_sales_det_lin_201712.id_tpv = sal_f_sales_det_cab.id_tpv) AND (sal_f_sales_det_lin_201712.id_ticket = sal_f_sales_det_cab.id_ticket))
  • Buffers: shared hit=7157963
  • Worker 0: actual time=0.006..0.008 rows=6 loops=446298
  • Buffers: shared hit=2291357
  • Worker 1: actual time=0.006..0.008 rows=6 loops=455838
  • Buffers: shared hit=2339549
  • Worker 2: actual time=0.006..0.008 rows=6 loops=451854
  • Buffers: shared hit=2318525
Planning time : 36.106 ms
Execution time : 9,729.587 ms