explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

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

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

Nested Loop (cost=0.00..481,506.38 rows=1 width=128) (actual time=0.119..5,104.755 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.144..5936.068 rows=2467588 loops=1
  • Buffers: shared hit=2270538
  • Worker 1: actual time=0.129..6128.895 rows=2582668 loops=1
  • Buffers: shared hit=2343160
  • Worker 2: actual time=0.122..6036.010 rows=2583382 loops=1
  • Buffers: shared hit=2351624
3. 47.296 227.856 ↑ 1.3 348,700 4 / 4

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

  • Buffers: shared hit=14450
  • Worker 0: actual time=0.027..280.375 rows=441845 loops=1
  • Buffers: shared hit=4595
  • Worker 1: actual time=0.025..293.351 rows=455469 loops=1
  • Buffers: shared hit=4707
  • Worker 2: actual time=0.024..289.754 rows=457075 loops=1
  • Buffers: shared hit=4741
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. 180.559 180.559 ↑ 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.021..180.559 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.026..221.443 rows=441845 loops=1
  • Buffers: shared hit=4595
  • Worker 1: actual time=0.023..232.704 rows=455469 loops=1
  • Buffers: shared hit=4707
  • Worker 2: actual time=0.022..227.878 rows=457075 loops=1
  • Buffers: shared hit=4741
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=441845
  • Buffers: shared hit=2265943
  • Worker 1: actual time=0.007..0.010 rows=6 loops=455469
  • Buffers: shared hit=2338453
  • Worker 2: actual time=0.007..0.009 rows=6 loops=457075
  • Buffers: shared hit=2346883
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=441845
  • Worker 1: actual time=0.000..0.000 rows=0 loops=455469
  • Worker 2: actual time=0.000..0.000 rows=0 loops=457075
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=441845
  • Buffers: shared hit=2265943
  • Worker 1: actual time=0.006..0.008 rows=6 loops=455469
  • Buffers: shared hit=2338453
  • Worker 2: actual time=0.006..0.008 rows=6 loops=457075
  • Buffers: shared hit=2346883
Planning time : 37.973 ms
Execution time : 9,225.734 ms