explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

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

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

Nested Loop (cost=0.00..305,403.85 rows=1 width=128) (actual time=0.113..3,945.999 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.107..4964.424 rows=2653487 loops=1
  • Buffers: shared hit=1445767
  • Worker 1: actual time=0.124..4843.783 rows=2591350 loops=1
  • Buffers: shared hit=1402022
  • Worker 2: actual time=0.126..4916.226 rows=2617387 loops=1
  • Buffers: shared hit=1403712
3. 28.626 150.688 ↑ 1.3 207,169 4 / 4

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

  • Buffers: shared hit=10209
  • Worker 0: actual time=0.022..196.323 rows=276091 loops=1
  • Buffers: shared hit=3518
  • Worker 1: actual time=0.033..187.660 rows=268032 loops=1
  • Buffers: shared hit=2731
  • Worker 2: actual time=0.021..197.205 rows=268000 loops=1
  • Buffers: shared hit=3344
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.000..0.000 rows=0 loops=1
5. 122.061 122.061 ↑ 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.021..122.061 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.019..157.956 rows=276091 loops=1
  • Buffers: shared hit=3518
  • Worker 1: actual time=0.033..152.505 rows=268032 loops=1
  • Buffers: shared hit=2731
  • Worker 2: actual time=0.021..159.153 rows=268000 loops=1
  • Buffers: shared hit=3344
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=276091
  • Buffers: shared hit=1442249
  • Worker 1: actual time=0.008..0.013 rows=10 loops=268032
  • Buffers: shared hit=1399291
  • Worker 2: actual time=0.008..0.013 rows=10 loops=268000
  • Buffers: shared hit=1400368
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=276091
  • Worker 1: actual time=0.000..0.000 rows=0 loops=268032
  • Worker 2: actual time=0.000..0.000 rows=0 loops=268000
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=276091
  • Buffers: shared hit=1442249
  • Worker 1: actual time=0.007..0.010 rows=10 loops=268032
  • Buffers: shared hit=1399291
  • Worker 2: actual time=0.007..0.010 rows=10 loops=268000
  • Buffers: shared hit=1400368
Planning time : 39.024 ms
Execution time : 10,366.401 ms