explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3,710.861 8,784.786 ↓ 7,842,839.0 7,842,839 1

Gather (cost=1,000.00..482,506.48 rows=1 width=128) (actual time=2.382..8,784.786 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,012.651 5,073.925 ↓ 1,960,710.0 1,960,710 4 / 4

Nested Loop (cost=0.00..481,506.38 rows=1 width=128) (actual time=0.115..5,073.925 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.116..6050.464 rows=2597427 loops=1
  • Buffers: shared hit=2372085
  • Worker 1: actual time=0.126..5955.438 rows=2532897 loops=1
  • Buffers: shared hit=2313769
  • Worker 2: actual time=0.140..6060.296 rows=2519015 loops=1
  • Buffers: shared hit=2296200
3. 45.708 225.580 ↑ 1.3 348,700 4 / 4

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

  • Buffers: shared hit=14450
  • Worker 0: actual time=0.022..290.359 rows=461639 loops=1
  • Buffers: shared hit=4763
  • Worker 1: actual time=0.026..273.608 rows=449928 loops=1
  • Buffers: shared hit=4631
  • Worker 2: actual time=0.024..291.220 rows=446174 loops=1
  • Buffers: shared hit=4599
4. 0.000 0.000 ↓ 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.000..0.000 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.000..0.000 rows=0 loops=1
5. 179.872 179.872 ↑ 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.020..179.872 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.021..228.114 rows=461639 loops=1
  • Buffers: shared hit=4763
  • Worker 1: actual time=0.025..218.969 rows=449928 loops=1
  • Buffers: shared hit=4631
  • Worker 2: actual time=0.024..232.211 rows=446174 loops=1
  • Buffers: shared hit=4599
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.009 rows=6 loops=461639
  • Buffers: shared hit=2367322
  • Worker 1: actual time=0.007..0.010 rows=6 loops=449928
  • Buffers: shared hit=2309138
  • Worker 2: actual time=0.007..0.010 rows=6 loops=446174
  • Buffers: shared hit=2291601
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=461639
  • Worker 1: actual time=0.000..0.000 rows=0 loops=449928
  • Worker 2: actual time=0.000..0.000 rows=0 loops=446174
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=461639
  • Buffers: shared hit=2367322
  • Worker 1: actual time=0.006..0.008 rows=6 loops=449928
  • Buffers: shared hit=2309138
  • Worker 2: actual time=0.006..0.008 rows=6 loops=446174
  • Buffers: shared hit=2291601
Planning time : 36.563 ms
Execution time : 9,302.729 ms