explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cMxu : Optimization for: idx02_sal_f_sales_det_cab_201712; plan #vfaz

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 5,543.536 9,445.201 ↓ 8,007,249.0 8,007,249 1

Gather (cost=1,000.00..306,403.95 rows=1 width=128) (actual time=2.682..9,445.201 rows=8,007,249 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=4338980
2. 1,058.531 3,901.665 ↓ 2,001,812.0 2,001,812 4 / 4

Nested Loop (cost=0.00..305,403.85 rows=1 width=128) (actual time=0.095..3,901.665 rows=2,001,812 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=4338317
  • Worker 0: actual time=0.134..4921.263 rows=2665404 loops=1
  • Buffers: shared hit=1441802
  • Worker 1: actual time=0.086..4835.707 rows=2592111 loops=1
  • Buffers: shared hit=1402199
  • Worker 2: actual time=0.085..4849.753 rows=2609001 loops=1
  • Buffers: shared hit=1417828
3. 28.675 149.937 ↑ 1.3 207,169 4 / 4

Append (cost=0.00..14,218.72 rows=267,316 width=45) (actual time=0.020..149.937 rows=207,169 loops=4)

  • Buffers: shared hit=10209
  • Worker 0: actual time=0.025..195.608 rows=275586 loops=1
  • Buffers: shared hit=2808
  • Worker 1: actual time=0.023..191.101 rows=267495 loops=1
  • Buffers: shared hit=3568
  • Worker 2: actual time=0.019..194.708 rows=270959 loops=1
  • Buffers: shared hit=3684
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 >= '2020-04-01'::date) AND (sal_f_sales_det_cab.dt_sale <= '2020-04-30'::date))
  • Worker 0: actual time=0.001..0.001 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. 121.261 121.261 ↑ 1.3 207,169 4 / 4

Parallel Seq Scan on public.sal_f_sales_det_cab_202004 (cost=0.00..14,218.72 rows=267,315 width=45) (actual time=0.019..121.261 rows=207,169 loops=4)

  • Output: sal_f_sales_det_cab_202004.id_store, sal_f_sales_det_cab_202004.id_tpv, sal_f_sales_det_cab_202004.id_ticket, sal_f_sales_det_cab_202004.id_cash, sal_f_sales_det_cab_202004.dt_sale, sal_f_sales_det_cab_202004.ti_hour, sal_f_sales_det_cab_202004.id_ticket_type, sal_f_sales_det_cab_202004.vl_sale, sal_f_sales_det_cab_202004.co_service, sal_f_sales_det_cab_202004.co_card
  • Filter: ((sal_f_sales_det_cab_202004.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_cab_202004.dt_sale <= '2020-04-30'::date))
  • Buffers: shared hit=10209
  • Worker 0: actual time=0.024..157.278 rows=275586 loops=1
  • Buffers: shared hit=2808
  • Worker 1: actual time=0.023..154.400 rows=267495 loops=1
  • Buffers: shared hit=3568
  • Worker 2: actual time=0.017..157.678 rows=270959 loops=1
  • Buffers: shared hit=3684
6. 621.507 2,693.197 ↓ 5.0 10 828,676 / 4

Append (cost=0.00..1.07 rows=2 width=83) (actual time=0.009..0.013 rows=10 loops=828,676)

  • Buffers: shared hit=4328108
  • Worker 0: actual time=0.008..0.012 rows=10 loops=275586
  • Buffers: shared hit=1438994
  • Worker 1: actual time=0.008..0.012 rows=10 loops=267495
  • Buffers: shared hit=1398631
  • Worker 2: actual time=0.008..0.012 rows=10 loops=270959
  • Buffers: shared hit=1414144
7. 0.000 0.000 ↓ 0.0 0 828,676 / 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=828,676)

  • 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 >= '2020-04-01'::date) AND (sal_f_sales_det_lin.dt_sale <= '2020-04-30'::date) AND (sal_f_sales_det_lin.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_lin.dt_sale <= '2020-04-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=275586
  • Worker 1: actual time=0.000..0.000 rows=0 loops=267495
  • Worker 2: actual time=0.000..0.000 rows=0 loops=270959
8. 2,071.690 2,071.690 ↓ 10.0 10 828,676 / 4

Index Scan using idx04_sal_f_sales_det_lin_202004 on public.sal_f_sales_det_lin_202004 (cost=0.56..1.07 rows=1 width=83) (actual time=0.007..0.010 rows=10 loops=828,676)

  • Output: sal_f_sales_det_lin_202004.id_store, sal_f_sales_det_lin_202004.id_tpv, sal_f_sales_det_lin_202004.id_ticket, sal_f_sales_det_lin_202004.id_cash, sal_f_sales_det_lin_202004.dt_sale, sal_f_sales_det_lin_202004.ti_hour, sal_f_sales_det_lin_202004.id_ticket_type, sal_f_sales_det_lin_202004.id_line_type, sal_f_sales_det_lin_202004.co_department, sal_f_sales_det_lin_202004.vl_sale_ori, sal_f_sales_det_lin_202004.vl_sale, sal_f_sales_det_lin_202004.qt_units, sal_f_sales_det_lin_202004.co_section, sal_f_sales_det_lin_202004.id_tax, sal_f_sales_det_lin_202004.co_product, sal_f_sales_det_lin_202004.id_offer, sal_f_sales_det_lin_202004.vl_amount, sal_f_sales_det_lin_202004.id_format, sal_f_sales_det_lin_202004.co_auxiliar
  • Index Cond: ((sal_f_sales_det_lin_202004.dt_sale = sal_f_sales_det_cab.dt_sale) AND (sal_f_sales_det_lin_202004.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_lin_202004.dt_sale <= '2020-04-30'::date) AND (sal_f_sales_det_lin_202004.dt_sale >= '2020-04-01'::date) AND (sal_f_sales_det_lin_202004.dt_sale <= '2020-04-30'::date) AND (sal_f_sales_det_lin_202004.ti_hour = sal_f_sales_det_cab.ti_hour) AND (sal_f_sales_det_lin_202004.id_store = sal_f_sales_det_cab.id_store) AND (sal_f_sales_det_lin_202004.id_cash = sal_f_sales_det_cab.id_cash) AND (sal_f_sales_det_lin_202004.id_tpv = sal_f_sales_det_cab.id_tpv) AND (sal_f_sales_det_lin_202004.id_ticket = sal_f_sales_det_cab.id_ticket))
  • Buffers: shared hit=4328108
  • Worker 0: actual time=0.007..0.010 rows=10 loops=275586
  • Buffers: shared hit=1438994
  • Worker 1: actual time=0.007..0.010 rows=10 loops=267495
  • Buffers: shared hit=1398631
  • Worker 2: actual time=0.007..0.010 rows=10 loops=270959
  • Buffers: shared hit=1414144
Planning time : 39.631 ms
Execution time : 9,989.144 ms