explain.depesz.com

PostgreSQL's explain analyze made readable

Result: riHq : Optimization for: Optimization for: Optimization for: idx04_sal_f_sales_det_cab_201712; plan #Kjt3; plan #vuwO; plan #74md

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 4,040.027 9,088.880 ↓ 7,842,839.0 7,842,839 1

Gather (cost=1,000.00..482,503.25 rows=1 width=128) (actual time=2.339..9,088.880 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. 986.641 5,048.853 ↓ 1,960,710.0 1,960,710 4 / 4

Nested Loop (cost=0.00..481,503.15 rows=1 width=128) (actual time=0.133..5,048.853 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.127..6053.912 rows=2585371 loops=1
  • Buffers: shared hit=2363000
  • Worker 1: actual time=0.201..6058.082 rows=2562457 loops=1
  • Buffers: shared hit=2346388
  • Worker 2: actual time=0.127..5851.349 rows=2496153 loops=1
  • Buffers: shared hit=2261948
3. 46.913 226.518 ↑ 1.3 348,700 4 / 4

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

  • Buffers: shared hit=14450
  • Worker 0: actual time=0.025..292.187 rows=459639 loops=1
  • Buffers: shared hit=4759
  • Worker 1: actual time=0.030..294.141 rows=456296 loops=1
  • Buffers: shared hit=4737
  • Worker 2: actual time=0.024..273.251 rows=439621 loops=1
  • Buffers: shared hit=4559
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.001..0.001 rows=0 loops=1
  • Worker 2: actual time=0.001..0.001 rows=0 loops=1
5. 179.604 179.604 ↑ 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..179.604 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.025..231.069 rows=459639 loops=1
  • Buffers: shared hit=4759
  • Worker 1: actual time=0.029..232.085 rows=456296 loops=1
  • Buffers: shared hit=4737
  • Worker 2: actual time=0.023..215.426 rows=439621 loops=1
  • Buffers: shared hit=4559
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=459639
  • Buffers: shared hit=2358241
  • Worker 1: actual time=0.007..0.010 rows=6 loops=456296
  • Buffers: shared hit=2341651
  • Worker 2: actual time=0.007..0.010 rows=6 loops=439621
  • Buffers: shared hit=2257389
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.dt_sale = sal_f_sales_det_lin.dt_sale) 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))
  • Worker 0: actual time=0.000..0.000 rows=0 loops=459639
  • Worker 1: actual time=0.000..0.000 rows=0 loops=456296
  • Worker 2: actual time=0.000..0.000 rows=0 loops=439621
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=459639
  • Buffers: shared hit=2358241
  • Worker 1: actual time=0.006..0.008 rows=6 loops=456296
  • Buffers: shared hit=2341651
  • Worker 2: actual time=0.006..0.008 rows=6 loops=439621
  • Buffers: shared hit=2257389
Planning time : 31.908 ms
Execution time : 9,607.760 ms