explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vfaz : idx02_sal_f_sales_det_cab_201712

Settings

Optimization(s) for this plan:

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

Gather (cost=1,000.00..306,403.95 rows=1 width=128) (actual time=2.533..9,628.170 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,119.449 3,963.702 ↓ 2,001,812.0 2,001,812 4 / 4

Nested Loop (cost=0.00..305,403.85 rows=1 width=128) (actual time=0.096..3,963.702 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.126..4990.971 rows=2648103 loops=1
  • Buffers: shared hit=1419135
  • Worker 1: actual time=0.090..4916.182 rows=2646603 loops=1
  • Buffers: shared hit=1450551
  • Worker 2: actual time=0.091..4806.062 rows=2552534 loops=1
  • Buffers: shared hit=1375697
3. 28.330 151.056 ↑ 1.3 207,169 4 / 4

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

  • Buffers: shared hit=10209
  • Worker 0: actual time=0.022..197.020 rows=271040 loops=1
  • Buffers: shared hit=2763
  • Worker 1: actual time=0.025..196.589 rows=277185 loops=1
  • Buffers: shared hit=3299
  • Worker 2: actual time=0.024..188.806 rows=262752 loops=1
  • Buffers: shared hit=3967
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.000..0.000 rows=0 loops=1
  • Worker 1: actual time=0.001..0.001 rows=0 loops=1
  • Worker 2: actual time=0.000..0.000 rows=0 loops=1
5. 122.725 122.725 ↑ 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..122.725 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.021..158.982 rows=271040 loops=1
  • Buffers: shared hit=2763
  • Worker 1: actual time=0.024..160.325 rows=277185 loops=1
  • Buffers: shared hit=3299
  • Worker 2: actual time=0.024..152.914 rows=262752 loops=1
  • Buffers: shared hit=3967
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.013 rows=10 loops=271040
  • Buffers: shared hit=1416372
  • Worker 1: actual time=0.008..0.012 rows=10 loops=277185
  • Buffers: shared hit=1447252
  • Worker 2: actual time=0.008..0.013 rows=10 loops=262752
  • Buffers: shared hit=1371730
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=271040
  • Worker 1: actual time=0.000..0.000 rows=0 loops=277185
  • Worker 2: actual time=0.000..0.000 rows=0 loops=262752
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=271040
  • Buffers: shared hit=1416372
  • Worker 1: actual time=0.007..0.010 rows=10 loops=277185
  • Buffers: shared hit=1447252
  • Worker 2: actual time=0.007..0.010 rows=10 loops=262752
  • Buffers: shared hit=1371730
Planning time : 41.534 ms
Execution time : 10,171.908 ms