explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZmPE : idx02_sal_f_sales_det_cab_201712

Settings

Optimization(s) for this plan:

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

Gather (cost=1,000.00..482,503.25 rows=1 width=128) (actual time=2.377..8,836.944 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. 982.449 5,043.053 ↓ 1,960,710.0 1,960,710 4 / 4

Nested Loop (cost=0.00..481,503.15 rows=1 width=128) (actual time=0.116..5,043.053 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.119..6022.323 rows=2575706 loops=1
  • Buffers: shared hit=2333097
  • Worker 1: actual time=0.127..6017.488 rows=2531768 loops=1
  • Buffers: shared hit=2307026
  • Worker 2: actual time=0.138..5920.740 rows=2533075 loops=1
  • Buffers: shared hit=2332471
3. 45.392 224.910 ↑ 1.3 348,700 4 / 4

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

  • Buffers: shared hit=14450
  • Worker 0: actual time=0.025..285.859 rows=453603 loops=1
  • Buffers: shared hit=4582
  • Worker 1: actual time=0.030..291.413 rows=448402 loops=1
  • Buffers: shared hit=4659
  • Worker 2: actual time=0.024..276.835 rows=453745 loops=1
  • Buffers: shared hit=4816
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. 179.517 179.517 ↑ 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.023..179.517 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.024..225.021 rows=453603 loops=1
  • Buffers: shared hit=4582
  • Worker 1: actual time=0.029..231.943 rows=448402 loops=1
  • Buffers: shared hit=4659
  • Worker 2: actual time=0.023..222.125 rows=453745 loops=1
  • Buffers: shared hit=4816
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=453603
  • Buffers: shared hit=2328515
  • Worker 1: actual time=0.007..0.010 rows=6 loops=448402
  • Buffers: shared hit=2302367
  • Worker 2: actual time=0.007..0.009 rows=6 loops=453745
  • Buffers: shared hit=2327655
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=453603
  • Worker 1: actual time=0.000..0.000 rows=0 loops=448402
  • Worker 2: actual time=0.000..0.000 rows=0 loops=453745
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=453603
  • Buffers: shared hit=2328515
  • Worker 1: actual time=0.006..0.008 rows=6 loops=448402
  • Buffers: shared hit=2302367
  • Worker 2: actual time=0.006..0.008 rows=6 loops=453745
  • Buffers: shared hit=2327655
Planning time : 37.766 ms
Execution time : 9,352.122 ms